Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge wcp to ljx_test #235

Merged
merged 30 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6c40cf2
Merge pull request #213 from opensourceways/test
zhongjun2 Jul 8, 2024
bf573c1
Merge pull request #214 from opensourceways/test
zhongjun2 Jul 9, 2024
9bf2c0c
update SigGathering
Kaede10 Jul 9, 2024
bc0f761
update SigGathering
Kaede10 Jul 9, 2024
a36865f
修改企业数据访问权限
Kaede10 Jul 10, 2024
3e54b03
update SigGathering format
Kaede10 Jul 11, 2024
13293c6
add moderation valid
Kaede10 Jul 11, 2024
64dade1
增加SigGathering申请修改次数限制
Kaede10 Jul 12, 2024
f3a56fd
SIG Gathering 申请成功发送短信通知
Kaede10 Jul 12, 2024
3c1c159
delete print info
Kaede10 Jul 12, 2024
3eb1d06
update user submission limit
Kaede10 Jul 13, 2024
3d538ab
使用Json库处理数据,避免转义问题
Kaede10 Jul 18, 2024
b0e0c2c
add test case, remove moderation in SigGathering
Kaede10 Jul 18, 2024
f364a99
add api repo/issues
Kaede10 Jul 22, 2024
30cff04
update
Kaede10 Jul 22, 2024
cd8541e
更新JDK镜像源
Kaede10 Jul 22, 2024
b5394d3
更新软件包维护者信息
Kaede10 Jul 23, 2024
0022628
Add api query/nps/issue to recive nps data and post issue to gitee
Kaede10 Jul 24, 2024
76d9f27
华为分析数据导出支持多环境
Kaede10 Jul 24, 2024
1ca4a5c
update
Kaede10 Jul 24, 2024
4588351
新增api query/repo/sig/list 返回所有仓库的sig组
Kaede10 Jul 25, 2024
9fff470
update query
Kaede10 Jul 25, 2024
1013e30
nps/issue增加ip调用次数限制
Kaede10 Jul 29, 2024
ecf6d73
反馈意见没有软件包信息不post issue
Kaede10 Jul 29, 2024
a739652
修改配置文件路径
Kaede10 Jul 30, 2024
1bbbf6d
修改配置文件大小写
Kaede10 Jul 30, 2024
ecf3889
update Dockerfile
Kaede10 Jul 30, 2024
3f9fdde
update
Kaede10 Jul 31, 2024
9d87ba3
add DetailsParmas
Kaede10 Jul 31, 2024
1206626
Merge branch 'ljx_test' into wcp
Kaede10 Jul 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ WORKDIR /var/lib/ds


RUN yum install -y wget \
&& wget https://mirrors-i.tuna.tsinghua.edu.cn/Adoptium/17/jdk/x64/linux/OpenJDK17U-jdk_x64_linux_hotspot_17.0.11_9.tar.gz \
&& tar -zxvf OpenJDK17U-jdk_x64_linux_hotspot_17.0.11_9.tar.gz \
&& wget https://mirrors-i.tuna.tsinghua.edu.cn/Adoptium/17/jdk/x64/linux/OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz \
&& tar -zxvf OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz \
&& wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz \
&& tar -xzvf apache-maven-3.8.8-bin.tar.gz \
&& yum install -y git

ENV JAVA_HOME=/var/lib/ds/jdk-17.0.11+9
ENV JAVA_HOME=/var/lib/ds/jdk-17.0.12+7
ENV PATH=${JAVA_HOME}/bin:$PATH

ENV MAVEN_HOEM=/var/lib/ds/apache-maven-3.8.8
Expand All @@ -26,6 +26,9 @@ ENV LC_ALL C.UTF-8

WORKDIR /var/lib/ds/datastat-server
COPY . /var/lib/ds/datastat-server

ENV CONFIG_PATH=/opt/config

RUN mvn clean install package -Dmaven.test.skip && \
mv ./target/ds-0.0.1-SNAPSHOT.jar ../ds.jar

Expand All @@ -35,4 +38,4 @@ RUN useradd -u 1000 datastat -s /bin/bash -m -U && \
chown -R datastat:datastat om-data

USER datastat
CMD java -jar ds.jar
CMD java -jar ds.jar --spring.config.location=${CONFIG_PATH}/application.properties
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/FoundryConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.springframework.context.annotation.PropertySource;

@ConfigurationProperties(prefix = "foundry")
@PropertySource(value = {"file:${user.dir}/foundry.properties"}, encoding = "UTF-8")
@PropertySource(value = {"file:${config.path}/foundry.properties"}, encoding = "UTF-8")
@Configuration("foundryConf")
@Data
public class FoundryConfig extends CustomPropertiesConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/MindSporeConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.springframework.context.annotation.PropertySource;

@ConfigurationProperties(prefix = "mindspore")
@PropertySource(value = {"file:${user.dir}/mindSpore.properties"}, encoding = "UTF-8")
@PropertySource(value = {"file:${config.path}/mindspore.properties"}, encoding = "UTF-8")
@Configuration("mindsporeConf")
@Data
public class MindSporeConfig extends CustomPropertiesConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/OpenEulerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.springframework.context.annotation.PropertySource;

@ConfigurationProperties(prefix = "openeuler")
@PropertySource(value = {"file:${user.dir}/openEuler.properties"}, encoding = "UTF-8")
@PropertySource(value = {"file:${config.path}/openeuler.properties"}, encoding = "UTF-8")
@Configuration("openeulerConf")
@Data
public class OpenEulerConfig extends CustomPropertiesConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/OpenGaussConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.springframework.core.env.Environment;

@ConfigurationProperties(prefix = "opengauss")
@PropertySource(value = {"file:${user.dir}/openGauss.properties"}, encoding = "UTF-8")
@PropertySource(value = {"file:${config.path}/opengauss.properties"}, encoding = "UTF-8")
@Configuration("opengaussConf")
@Data
public class OpenGaussConfig extends CustomPropertiesConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/OpenLookengConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.springframework.context.annotation.PropertySource;

@ConfigurationProperties(prefix = "openlookeng")
@PropertySource(value = {"file:${user.dir}/openLookeng.properties"}, encoding = "UTF-8")
@PropertySource(value = {"file:${config.path}/openlookeng.properties"}, encoding = "UTF-8")
@Configuration("openlookengConf")
@Data
public class OpenLookengConfig extends CustomPropertiesConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/QueryConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.springframework.context.annotation.PropertySource;

@ConfigurationProperties(prefix = "custom")
@PropertySource(value = {"file:${user.dir}/custom.properties"})
@PropertySource(value = {"file:${config.path}/custom.properties"})
@Configuration("queryConf")
@Data
public class QueryConfig extends CustomPropertiesConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datastat/config/SoftwareConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import lombok.Data;

@ConfigurationProperties(prefix = "software")
@PropertySource(value = {"file:${user.dir}/software.properties"}, encoding = "UTF-8")
@PropertySource(value = {"file:${config.path}/software.properties"}, encoding = "UTF-8")
@Configuration("softwareConf")
@Data
public class SoftwareConfig extends CustomPropertiesConfig {
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/com/datastat/constant/Constant.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.datastat.constant;

public final class Constant {

private Constant() {
throw new AssertionError("Constant class cannot be instantiated.");
}

public static final String SRC_OPENEULER = "src-openeuler";

public static final String FEEDBACK_OWNER = "openeuler";

public static final String FEEDBACK_REPO = "easy-software";

}
34 changes: 32 additions & 2 deletions src/main/java/com/datastat/controller/QueryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.datastat.aop.LimitRequest;
import com.datastat.aop.RateLimit;
import com.datastat.interceptor.authentication.UserLoginToken;
import com.datastat.interceptor.oneid.CompanyToken;
import com.datastat.interceptor.oneid.OneidToken;
import com.datastat.interceptor.oneid.SigToken;
import com.datastat.model.DatastatRequestBody;
Expand All @@ -25,6 +26,8 @@
import com.datastat.model.QaBotRequestBody;
import com.datastat.model.SigGathering;
import com.datastat.model.TeamupApplyForm;
import com.datastat.model.dto.ContributeRequestParams;
import com.datastat.model.dto.NpsIssueBody;
import com.datastat.model.meetup.MeetupApplyForm;
import com.datastat.model.vo.*;
import com.datastat.service.QueryService;
Expand Down Expand Up @@ -284,6 +287,7 @@ public String queryCompanyName(HttpServletRequest request,
}

@OneidToken
@CompanyToken
@RequestMapping("/company/usercontribute")
public String queryCompanyUserContribute(HttpServletRequest request,
@RequestParam(value = "community") String community,
Expand All @@ -295,6 +299,7 @@ public String queryCompanyUserContribute(HttpServletRequest request,
}

@OneidToken
@CompanyToken
@RequestMapping("/company/sigcontribute")
public String queryCompanySigcontribute(HttpServletRequest request,
@RequestParam(value = "community") String community,
Expand All @@ -306,6 +311,7 @@ public String queryCompanySigcontribute(HttpServletRequest request,
}

@OneidToken
@CompanyToken
@RequestMapping("/company/sigdetails")
public String queryCompanySigDetails(HttpServletRequest request,
@RequestParam(value = "community") String community,
Expand All @@ -325,6 +331,7 @@ public String querySigUserTypeCount(HttpServletRequest request,
}

@OneidToken
@CompanyToken
@RequestMapping("/company/users")
public String queryCompanyUsers(HttpServletRequest request,
@RequestParam(value = "community") String community,
Expand Down Expand Up @@ -630,6 +637,13 @@ public String queryRepoSigInfo(HttpServletRequest request,
return queryService.queryRepoSigInfo(request, community, repo);
}

@RequestMapping(value = "/repo/sig/list")
public String queryRepoSigInfoList(HttpServletRequest request,
@RequestParam(value = "community") String community,
@RequestParam(value = "repo", required = false) String repo) {
return queryService.queryRepoSigInfoList(request, community, repo);
}

@RequestMapping(value = "/software/info")
public String querySoftwareInfo(HttpServletRequest request,
@RequestParam(value = "community") String community,
Expand All @@ -646,8 +660,9 @@ public String querySoftwareAppDownload(HttpServletRequest request,
}

@RequestMapping(value = "/agc/analytics/callback", method = RequestMethod.POST)
public String callback(HttpServletRequest request, @RequestBody @Valid HmsExportDataReq req) {
return queryService.callback(request, req);
public String callback(HttpServletRequest request, @RequestParam(value = "path", required = false) String path,
@RequestBody @Valid HmsExportDataReq req) {
return queryService.callback(request, path, req);
}

@RequestMapping(value = "/isv/count", method = RequestMethod.POST)
Expand Down Expand Up @@ -773,4 +788,19 @@ public String addSigGathering(HttpServletRequest request,
String res = queryService.putSigGathering(request, community, sigGatherings, token);
return res;
}

@RequestMapping("/repo/issues")
public String queryRepoIssues(HttpServletRequest request, ContributeRequestParams params) throws Exception {
return queryService.queryRepoIssues(request, params);
}

@LimitRequest(callTime = 1, callCount = 1000)
@RateLimit
@RequestMapping(value = "/nps/issue", method = RequestMethod.POST)
public String putNpsIssue(HttpServletRequest request,
@CookieValue(value = "_Y_G_", required = false) String token,
@RequestParam(value = "community") String community,
@Valid @RequestBody NpsIssueBody body) {
return queryService.putNpsIssue(request, community, body, token);
}
}
Loading