-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from zhaoyiqing97/main
2.0.0
- Loading branch information
Showing
138 changed files
with
706,523 additions
and
1,119 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: "codiga" | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ "main" ] | ||
jobs: | ||
check-quality: | ||
runs-on: ubuntu-latest | ||
name: Codiga Check | ||
steps: | ||
- name: Check code meets quality standards | ||
id: codiga | ||
uses: codiga/github-action@master | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
codiga_api_token: ${{ secrets.CODIGA_API_TOKEN }} | ||
min_quality_grade: 'WARNING' | ||
min_quality_score: '50' | ||
max_defects_rate: '0.2' | ||
max_complex_functions_rate: '0.0001' | ||
max_long_functions_rate: '0.0001' | ||
project_name: 'github-action-example' | ||
max_timeout_sec: '600' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: elasticsearch image | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: The version of the Docker image to use. | ||
type: string | ||
required: true | ||
default: 1.0.0 | ||
|
||
env: | ||
# Use docker.io for Docker Hub if empty | ||
REGISTRY: ghcr.io | ||
# github.repository as <account>/<repo> | ||
IMAGE_NAME: big_three/elasticsearch | ||
USER_NAME: zhaoyiqing97 | ||
CONTEXT: ops/build/elasticsearch | ||
|
||
jobs: | ||
|
||
docker: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install cosign | ||
uses: sigstore/[email protected] | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
driver-opts: image=moby/buildkit:buildx-stable-1 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ env.USER_NAME }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.USER_NAME }}/${{ env.IMAGE_NAME }} | ||
flavor: | | ||
latest=auto | ||
tags: | | ||
type=semver,pattern={{version}},value=1.0.0 | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ${{env.CONTEXT}} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Sign the published Docker image | ||
env: | ||
COSIGN_EXPERIMENTAL: 1 | ||
run: cosign sign ${{ env.REGISTRY }}/${{ env.USER_NAME }}/${{ env.IMAGE_NAME }}:${{ steps.build-and-push.outputs.tags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
*.lock | ||
|
||
# Package Files # | ||
*.jar | ||
target/*.jar | ||
*.war | ||
*.ear | ||
target/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package generator.config; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.module.SimpleModule; | ||
import com.fasterxml.jackson.databind.ser.std.DateSerializer; | ||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.support.ReloadableResourceBundleMessageSource; | ||
|
||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
import java.util.TimeZone; | ||
|
||
import generator.constant.CommonConstant; | ||
|
||
/** | ||
* BeanConfig. | ||
* | ||
* @author 刘斌 | ||
* @version 0.0.1 | ||
* @serial 2022-08-16 : base version. | ||
*/ | ||
@Configuration | ||
public class BeanConfig { | ||
/** | ||
* jackSon 的 ObjectMapper | ||
* | ||
* @return ObjectMapper | ||
*/ | ||
@Bean | ||
public ObjectMapper objectMapper() { | ||
// 序列化设置 | ||
final ObjectMapper objectMapper = new ObjectMapper(); | ||
objectMapper.setTimeZone(TimeZone.getDefault()); | ||
// 序列换成json时,将所有的long变成string | ||
SimpleModule simpleModule = new SimpleModule(); | ||
simpleModule.addSerializer(Long.class, ToStringSerializer.instance); | ||
simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); | ||
// 日期序列化设置 | ||
JavaTimeModule javaTimeModule = new JavaTimeModule(); | ||
javaTimeModule.addSerializer(Date.class, new DateSerializer(false, new SimpleDateFormat(CommonConstant.DATE_TIME_FORMATTER_STRING))); | ||
objectMapper.registerModule(simpleModule).registerModule(javaTimeModule); | ||
|
||
return objectMapper; | ||
} | ||
|
||
/** | ||
* 国际化 | ||
* | ||
* @return 对象 | ||
*/ | ||
@Bean | ||
public ReloadableResourceBundleMessageSource messageSource() { | ||
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); | ||
messageSource.setBasename("classpath:org/springframework/security/messages_zh_CN"); | ||
return messageSource; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
backend/src/main/java/generator/config/ElasticsearchConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package generator.config; | ||
|
||
import org.elasticsearch.client.RestHighLevelClient; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.data.elasticsearch.client.ClientConfiguration; | ||
import org.springframework.data.elasticsearch.client.RestClients; | ||
import org.springframework.data.elasticsearch.config.AbstractElasticsearchConfiguration; | ||
|
||
/** | ||
* ElasticsearchConfiguration. | ||
* | ||
* @author 刘斌 | ||
* @version 0.0.1 | ||
* @serial 2022-08-18 : base version. | ||
*/ | ||
public class ElasticsearchConfiguration extends AbstractElasticsearchConfiguration { | ||
@Override | ||
@Bean | ||
public RestHighLevelClient elasticsearchClient() { | ||
final ClientConfiguration clientConfiguration = ClientConfiguration.builder() | ||
.connectedTo("localhost:9200") | ||
.build(); | ||
|
||
return RestClients.create(clientConfiguration).rest(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.