소스 검색

update config

2643616413 6 일 전
부모
커밋
4682efd98e

+ 51 - 0
server/yusp-tagging-core/pom.xml

@@ -34,6 +34,10 @@
             </exclusions>
         </dependency>
         <dependency>
+            <groupId>cn.com.yusys.yusp.common</groupId>
+            <artifactId>yusp-commons-starter-mybatisplus</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-validation</artifactId>
             <exclusions>
@@ -124,5 +128,52 @@
             <version>5.2.5</version>
         </dependency>
 
+
+<!--         2026.02.06新增-->
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+            <version>1.5.20</version> <!-- 版本号可根据需要调整 -->
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tomcat.embed</groupId>
+            <artifactId>tomcat-embed-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.30</version> <!-- 至少 1.18.16+ -->
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.4.3.4</version> <!-- 明确使用 3.4.x,支持 Java 8 -->
+            <exclusions>
+                <!-- 强制排除其可能引入的 HikariCP 4.x -->
+                <exclusion>
+                    <groupId>com.zaxxer</groupId>
+                    <artifactId>HikariCP</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>com.zaxxer</groupId>
+            <artifactId>HikariCP</artifactId>
+            <version>3.4.5</version> <!-- 最后一个支持 Java 8 的版本 -->
+            <scope>compile</scope>
+        </dependency>
+
     </dependencies>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>com.zaxxer</groupId>
+                <artifactId>HikariCP</artifactId>
+                <version>3.4.5</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
 </project>

+ 46 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/controller/TabAppController.java

@@ -0,0 +1,46 @@
+package cn.com.yusys.yusp.controller;
+
+import cn.com.yusys.yusp.domain.dto.TabAppCreateDTO;
+import cn.com.yusys.yusp.domain.entity.TabApp;
+import cn.com.yusys.yusp.service.TabAppService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/api/tab-app")
+public class TabAppController {
+
+    @Autowired
+    private TabAppService tabAppService;
+
+    @GetMapping("/list")
+    public Page<TabApp> listApps(
+            @RequestParam(defaultValue = "1") int page,
+            @RequestParam(defaultValue = "10") int size) {
+        return tabAppService.listApps(page, size);
+    }
+
+    @PostMapping("/add")
+    public TabApp addApp(@Validated @RequestBody TabAppCreateDTO dto) {
+        return tabAppService.addApp(dto);
+    }
+
+    @GetMapping("/query")
+    public List<TabApp> queryByName(@RequestParam String appName) {
+        return tabAppService.queryByName(appName);
+    }
+
+    @PutMapping("/reset-secret/{id}")
+    public String resetSecret(@PathVariable String id) {
+        return tabAppService.resetSecret(id);
+    }
+
+    @PutMapping("/disable/{id}")
+    public void disableApp(@PathVariable String id) {
+        tabAppService.disableApp(id);
+    }
+}

+ 16 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/dto/TabAppCreateDTO.java

@@ -0,0 +1,16 @@
+package cn.com.yusys.yusp.domain.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+@Data
+@ApiModel("新增应用请求DTO")
+public class TabAppCreateDTO {
+
+    @NotBlank(message = "应用名称不能为空")
+    @ApiModelProperty(value = "应用名称", required = true)
+    private String appName;
+}

+ 82 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/entity/TabApp.java

@@ -0,0 +1,82 @@
+package cn.com.yusys.yusp.domain.entity;
+
+import lombok.Data;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+import io.swagger.annotations.ApiModelProperty;
+import org.hibernate.validator.constraints.Length;
+
+/**
+ * 应用信息实体
+ * @TableName tab_app
+ */
+@Data
+public class TabApp implements Serializable {
+
+    /**
+     * 主键ID(UUID生成)
+     */
+    @NotBlank(message = "ID不能为空")
+    @Size(max = 100, message = "编码长度不能超过100")
+    @ApiModelProperty(value = "主键ID", required = true)
+    @Length(max = 100, message = "编码长度不能超过100")
+    private String id;
+
+    /**
+     * 应用名称
+     */
+    @NotBlank(message = "应用名称不能为空")
+    @Size(max = 100, message = "编码长度不能超过100")
+    @ApiModelProperty(value = "应用名称", required = true)
+    @Length(max = 100, message = "编码长度不能超过100")
+    private String appName;
+
+    /**
+     * 应用ID(YY+日期+序列号格式)
+     */
+    @Size(max = 100, message = "编码长度不能超过100")
+    @ApiModelProperty(value = "应用ID(非主键)")
+    @Length(max = 100, message = "编码长度不能超过100")
+    private String appId;
+
+    /**
+     * 应用密钥
+     */
+    @Size(max = 100, message = "编码长度不能超过100")
+    @ApiModelProperty(value = "应用密钥")
+    @Length(max = 100, message = "编码长度不能超过100")
+    private String appSecret;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /**
+     * 创建人姓名
+     */
+    @Size(max = 100, message = "编码长度不能超过100")
+    @ApiModelProperty(value = "创建人姓名")
+    @Length(max = 100, message = "编码长度不能超过100")
+    private String createrNm;
+
+    /**
+     * 创建人ID
+     */
+    @Size(max = 100, message = "编码长度不能超过100")
+    @ApiModelProperty(value = "创建人ID")
+    @Length(max = 100, message = "编码长度不能超过100")
+    private String createrId;
+
+    /**
+     * 状态:0启用;1禁用
+     */
+    @Size(max = 100, message = "编码长度不能超过100")
+    @ApiModelProperty(value = "状态:0启用;1禁用", example = "0")
+    @Length(max = 100, message = "编码长度不能超过100")
+    private String state;
+}

+ 373 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/entity/TabLog.java

@@ -0,0 +1,373 @@
+package cn.com.yusys.yusp.domain.entity;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+import javax.validation.constraints.NotNull;
+
+import java.io.Serializable;
+
+import java.util.Date;
+import io.swagger.annotations.ApiModelProperty;
+import org.hibernate.validator.constraints.Length;
+
+/**
+* 
+* @TableName tab_log
+*/
+public class TabLog implements Serializable {
+
+    /**
+    * 
+    */
+    @NotBlank(message="[]不能为空")
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String id;
+    /**
+    * 应用ID
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("应用ID")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String appId;
+    /**
+    * 调用时间
+    */
+    @ApiModelProperty("调用时间")
+    private Date insertTime;
+    /**
+    * 业务属性,贷款编号
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("业务属性,贷款编号")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String businessAttr;
+    /**
+    * tab_tag_category的主键
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("tab_tag_category的主键")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String category;
+    /**
+    * 输入短语
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("输入短语")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String phrase;
+    /**
+    * 附件名称
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("附件名称")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String attachment;
+    /**
+    * 附件路径
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("附件路径")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String attachmentUrl;
+    /**
+    * 打标结果,JSON
+[{
+label:xxx,
+label_code:xxx,
+desc:xxx
+passr: true/false
+}]
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("打标结果,JSON [{label:xxx, label_code:xxx, desc:xxx passr: true/false }]")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String result;
+    /**
+    * 反馈人ID
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("反馈人ID")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String feedbackUserId;
+    /**
+    * 反馈人名字
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("反馈人名字")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String feedbackUserNm;
+    /**
+    * 反馈时间
+    */
+    @ApiModelProperty("反馈时间")
+    private Date feedbackTime;
+    /**
+    * 反馈,agree/reject
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("反馈,agree/reject")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String feedback;
+    /**
+    * JSON
+[
+{
+ label:xxx,
+ label_code:xxx,
+ desc:xxx
+ passr: true/false
+}
+]
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("JSON {label:xxx, label_code:xxx, desc:xxx passr: true/false}]")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String feedbackResult;
+    /**
+    * 0:打标执行中;1:打标完成; 2:客户经理已经确认
+    */
+    @ApiModelProperty("0:打标执行中;1:打标完成; 2:客户经理已经确认")
+    private Integer state;
+
+    /**
+    * 
+    */
+    private void setId(String id){
+    this.id = id;
+    }
+
+    /**
+    * 应用ID
+    */
+    private void setAppId(String appId){
+    this.appId = appId;
+    }
+
+    /**
+    * 调用时间
+    */
+    private void setInsertTime(Date insertTime){
+    this.insertTime = insertTime;
+    }
+
+    /**
+    * 业务属性,贷款编号
+    */
+    private void setBusinessAttr(String businessAttr){
+    this.businessAttr = businessAttr;
+    }
+
+    /**
+    * tab_tag_category的主键
+    */
+    private void setCategory(String category){
+    this.category = category;
+    }
+
+    /**
+    * 输入短语
+    */
+    private void setPhrase(String phrase){
+    this.phrase = phrase;
+    }
+
+    /**
+    * 附件名称
+    */
+    private void setAttachment(String attachment){
+    this.attachment = attachment;
+    }
+
+    /**
+    * 附件路径
+    */
+    private void setAttachmentUrl(String attachmentUrl){
+    this.attachmentUrl = attachmentUrl;
+    }
+
+    /**
+    * 打标结果,JSON
+[{
+label:xxx,
+label_code:xxx,
+desc:xxx
+passr: true/false
+}]
+    */
+    private void setResult(String result){
+    this.result = result;
+    }
+
+    /**
+    * 反馈人ID
+    */
+    private void setFeedbackUserId(String feedbackUserId){
+    this.feedbackUserId = feedbackUserId;
+    }
+
+    /**
+    * 反馈人名字
+    */
+    private void setFeedbackUserNm(String feedbackUserNm){
+    this.feedbackUserNm = feedbackUserNm;
+    }
+
+    /**
+    * 反馈时间
+    */
+    private void setFeedbackTime(Date feedbackTime){
+    this.feedbackTime = feedbackTime;
+    }
+
+    /**
+    * 反馈,agree/reject
+    */
+    private void setFeedback(String feedback){
+    this.feedback = feedback;
+    }
+
+    /**
+    * JSON
+[
+{
+ label:xxx,
+ label_code:xxx,
+ desc:xxx
+ passr: true/false
+}
+]
+    */
+    private void setFeedbackResult(String feedbackResult){
+    this.feedbackResult = feedbackResult;
+    }
+
+    /**
+    * 0:打标执行中;1:打标完成; 2:客户经理已经确认
+    */
+    private void setState(Integer state){
+    this.state = state;
+    }
+
+
+    /**
+    * 
+    */
+    private String getId(){
+    return this.id;
+    }
+
+    /**
+    * 应用ID
+    */
+    private String getAppId(){
+    return this.appId;
+    }
+
+    /**
+    * 调用时间
+    */
+    private Date getInsertTime(){
+    return this.insertTime;
+    }
+
+    /**
+    * 业务属性,贷款编号
+    */
+    private String getBusinessAttr(){
+    return this.businessAttr;
+    }
+
+    /**
+    * tab_tag_category的主键
+    */
+    private String getCategory(){
+    return this.category;
+    }
+
+    /**
+    * 输入短语
+    */
+    private String getPhrase(){
+    return this.phrase;
+    }
+
+    /**
+    * 附件名称
+    */
+    private String getAttachment(){
+    return this.attachment;
+    }
+
+    /**
+    * 附件路径
+    */
+    private String getAttachmentUrl(){
+    return this.attachmentUrl;
+    }
+
+    /**
+    * 打标结果,JSON
+[{
+label:xxx,
+label_code:xxx,
+desc:xxx
+passr: true/false
+}]
+    */
+    private String getResult(){
+    return this.result;
+    }
+
+    /**
+    * 反馈人ID
+    */
+    private String getFeedbackUserId(){
+    return this.feedbackUserId;
+    }
+
+    /**
+    * 反馈人名字
+    */
+    private String getFeedbackUserNm(){
+    return this.feedbackUserNm;
+    }
+
+    /**
+    * 反馈时间
+    */
+    private Date getFeedbackTime(){
+    return this.feedbackTime;
+    }
+
+    /**
+    * 反馈,agree/reject
+    */
+    private String getFeedback(){
+    return this.feedback;
+    }
+
+    /**
+    * JSON
+[
+{
+ label:xxx,
+ label_code:xxx,
+ desc:xxx
+ passr: true/false
+}
+]
+    */
+    private String getFeedbackResult(){
+    return this.feedbackResult;
+    }
+
+    /**
+    * 0:打标执行中;1:打标完成; 2:客户经理已经确认
+    */
+    private Integer getState(){
+    return this.state;
+    }
+
+}

+ 103 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/entity/TabTagCategory.java

@@ -0,0 +1,103 @@
+package cn.com.yusys.yusp.domain.entity;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+import javax.validation.constraints.NotNull;
+
+import java.io.Serializable;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.hibernate.validator.constraints.Length;
+
+/**
+* 
+* @TableName tab_tag_category
+*/
+public class TabTagCategory implements Serializable {
+
+    /**
+    * 
+    */
+    @NotBlank(message="[]不能为空")
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String id;
+    /**
+    * 类别代码
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("类别代码")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String categoryCode;
+    /**
+    * 类别名称
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("类别名称")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String categoryNm;
+    /**
+    * 0启用;1停用
+    */
+    @ApiModelProperty("0启用;1停用")
+    private Integer state;
+
+    /**
+    * 
+    */
+    private void setId(String id){
+    this.id = id;
+    }
+
+    /**
+    * 类别代码
+    */
+    private void setCategoryCode(String categoryCode){
+    this.categoryCode = categoryCode;
+    }
+
+    /**
+    * 类别名称
+    */
+    private void setCategoryNm(String categoryNm){
+    this.categoryNm = categoryNm;
+    }
+
+    /**
+    * 0启用;1停用
+    */
+    private void setState(Integer state){
+    this.state = state;
+    }
+
+
+    /**
+    * 
+    */
+    private String getId(){
+    return this.id;
+    }
+
+    /**
+    * 类别代码
+    */
+    private String getCategoryCode(){
+    return this.categoryCode;
+    }
+
+    /**
+    * 类别名称
+    */
+    private String getCategoryNm(){
+    return this.categoryNm;
+    }
+
+    /**
+    * 0启用;1停用
+    */
+    private Integer getState(){
+    return this.state;
+    }
+
+}

+ 189 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/domain/entity/TabTagInfo.java

@@ -0,0 +1,189 @@
+package cn.com.yusys.yusp.domain.entity;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+import javax.validation.constraints.NotNull;
+
+import java.io.Serializable;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.hibernate.validator.constraints.Length;
+
+/**
+* 
+* @TableName tab_tag_info
+*/
+public class TabTagInfo implements Serializable {
+
+    /**
+    * 
+    */
+    @NotBlank(message="[]不能为空")
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String id;
+    /**
+    * 所属大类
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("所属大类")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String categoryId;
+    /**
+    * 标签名称
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("标签名称")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String tagNm;
+    /**
+    * 标签代码
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("标签代码")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String tagCode;
+    /**
+    * 标签备注
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("标签备注")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String tagRemark;
+    /**
+    * 父级ID
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("父级ID")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String parentId;
+    /**
+    * 标签规则
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("标签规则")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String reg;
+    /**
+    * 标签提示词
+    */
+    @Size(max= 100,message="编码长度不能超过100")
+    @ApiModelProperty("标签提示词")
+    @Length(max= 100,message="编码长度不能超过100")
+    private String prompt;
+
+    /**
+    * 
+    */
+    private void setId(String id){
+    this.id = id;
+    }
+
+    /**
+    * 所属大类
+    */
+    private void setCategoryId(String categoryId){
+    this.categoryId = categoryId;
+    }
+
+    /**
+    * 标签名称
+    */
+    private void setTagNm(String tagNm){
+    this.tagNm = tagNm;
+    }
+
+    /**
+    * 标签代码
+    */
+    private void setTagCode(String tagCode){
+    this.tagCode = tagCode;
+    }
+
+    /**
+    * 标签备注
+    */
+    private void setTagRemark(String tagRemark){
+    this.tagRemark = tagRemark;
+    }
+
+    /**
+    * 父级ID
+    */
+    private void setParentId(String parentId){
+    this.parentId = parentId;
+    }
+
+    /**
+    * 标签规则
+    */
+    private void setReg(String reg){
+    this.reg = reg;
+    }
+
+    /**
+    * 标签提示词
+    */
+    private void setPrompt(String prompt){
+    this.prompt = prompt;
+    }
+
+
+    /**
+    * 
+    */
+    private String getId(){
+    return this.id;
+    }
+
+    /**
+    * 所属大类
+    */
+    private String getCategoryId(){
+    return this.categoryId;
+    }
+
+    /**
+    * 标签名称
+    */
+    private String getTagNm(){
+    return this.tagNm;
+    }
+
+    /**
+    * 标签代码
+    */
+    private String getTagCode(){
+    return this.tagCode;
+    }
+
+    /**
+    * 标签备注
+    */
+    private String getTagRemark(){
+    return this.tagRemark;
+    }
+
+    /**
+    * 父级ID
+    */
+    private String getParentId(){
+    return this.parentId;
+    }
+
+    /**
+    * 标签规则
+    */
+    private String getReg(){
+    return this.reg;
+    }
+
+    /**
+    * 标签提示词
+    */
+    private String getPrompt(){
+    return this.prompt;
+    }
+
+}

+ 35 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/mapper/TabAppMapper.java

@@ -0,0 +1,35 @@
+package cn.com.yusys.yusp.mapper;
+
+import cn.com.yusys.yusp.domain.entity.TabApp;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface TabAppMapper {
+
+    // 分页查询(偏移量 + 限制)
+    List<TabApp> selectPageApps(@Param("offset") int offset, @Param("limit") int limit);
+
+    // 按应用名称查重
+    int selectCountByName(@Param("appName") String appName);
+
+    // 新增
+    void insertApp(TabApp app);
+
+    // 按 ID 查询
+    TabApp selectById(@Param("id") String id);
+
+    // 按应用名称查询(仅三字段)
+    List<TabApp> selectByName(@Param("appName") String appName);
+
+    // 重置密钥
+    void updateAppSecret(@Param("id") String id, @Param("appSecret") String appSecret);
+
+    // 禁用应用
+    void disableApp(@Param("id") String id);
+
+    // 全表计数(分页总数)
+    long selectCountAll();
+}

+ 15 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/TabAppService.java

@@ -0,0 +1,15 @@
+package cn.com.yusys.yusp.service;
+
+import cn.com.yusys.yusp.domain.entity.TabApp;
+import cn.com.yusys.yusp.domain.dto.TabAppCreateDTO;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+
+import java.util.List;
+
+public interface TabAppService {
+    Page<TabApp> listApps(int page, int size);
+    TabApp addApp(TabAppCreateDTO dto);
+    List<TabApp> queryByName(String appName);
+    String resetSecret(String id);
+    void disableApp(String id);
+}

+ 95 - 0
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/impl/TabAppServiceImpl.java

@@ -0,0 +1,95 @@
+package cn.com.yusys.yusp.service.impl;
+
+import cn.com.yusys.yusp.domain.dto.TabAppCreateDTO;
+import cn.com.yusys.yusp.domain.entity.TabApp;
+import cn.com.yusys.yusp.mapper.TabAppMapper;
+import cn.com.yusys.yusp.service.TabAppService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
+
+@Service
+public class TabAppServiceImpl implements TabAppService {
+
+    @Autowired
+    private TabAppMapper tabAppMapper;
+
+    @Override
+    public Page<TabApp> listApps(int page, int size) {
+        int offset = (page - 1) * size;
+        List<TabApp> records = tabAppMapper.selectPageApps(offset, size);
+        long total = tabAppMapper.selectCountAll();
+        Page<TabApp> pageObj = new Page<>(page, size, total);
+        pageObj.setRecords(records);
+        return pageObj;
+    }
+
+    @Override
+    public TabApp addApp(TabAppCreateDTO dto) {
+        String appName = dto.getAppName();
+
+        // 校验唯一性
+        if (tabAppMapper.selectCountByName(appName) > 0) {
+            throw new RuntimeException("应用名称已存在");
+        }
+
+        String id = java.util.UUID.randomUUID().toString();
+        String appId = "YY" +
+                new SimpleDateFormat("yyyyMMdd").format(new Date()) +
+                "001" +
+                String.format("%06d", new Random().nextInt(1000000));
+        String appSecret = generateRandomString(25);
+
+        TabApp app = new TabApp();
+        app.setId(id);
+        app.setAppName(appName);
+        app.setAppId(appId);
+        app.setAppSecret(appSecret);
+        app.setCreateTime(new Date());
+        app.setState("0");
+
+        tabAppMapper.insertApp(app);
+        return app;
+    }
+
+    @Override
+    public List<TabApp> queryByName(String appName) {
+        return tabAppMapper.selectByName(appName);
+    }
+
+    @Override
+    public String resetSecret(String id) {
+        TabApp app = tabAppMapper.selectById(id);
+        if (app == null) {
+            throw new RuntimeException("应用不存在");
+        }
+
+        String newSecret = generateRandomString(25);
+        tabAppMapper.updateAppSecret(id, newSecret);
+        return newSecret;
+    }
+
+    @Override
+    public void disableApp(String id) {
+        TabApp app = tabAppMapper.selectById(id);
+        if (app == null) {
+            throw new RuntimeException("应用不存在");
+        }
+        tabAppMapper.disableApp(id);
+    }
+
+    private String generateRandomString(int length) {
+        String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+        StringBuilder sb = new StringBuilder();
+        Random random = new Random();
+        for (int i = 0; i < length; i++) {
+            sb.append(chars.charAt(random.nextInt(chars.length())));
+        }
+        return sb.toString();
+    }
+}

+ 86 - 0
server/yusp-tagging-core/src/main/resources/mapper/TabAppMapper.xml

@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="cn.com.yusys.yusp.mapper.TabAppMapper">
+
+    <!-- 1. 分页查询 -->
+    <select id="selectPageApps" parameterType="map" resultType="cn.com.yusys.yusp.domain.entity.TabApp">
+        SELECT
+            id,
+            app_name,
+            app_id,
+            app_secret,
+            create_time,
+            creater_nm,
+            creater_id,
+            state
+        FROM tab_app
+        ORDER BY create_time DESC
+            LIMIT #{offset}, #{limit}
+    </select>
+
+    <!-- 2. 按应用名称查重(用于新增前校验) -->
+    <select id="selectCountByName" parameterType="string" resultType="java.lang.Integer">
+        SELECT COUNT(*)
+        FROM tab_app
+        WHERE app_name = #{appName}
+    </select>
+
+    <!-- 3. 新增应用(插入全部字段) -->
+    <insert id="insertApp" parameterType="cn.com.yusys.yusp.domain.entity.TabApp">
+        INSERT INTO tab_app (
+            id,
+            app_name,
+            app_id,
+            app_secret,
+            create_time,
+            creater_nm,
+            creater_id,
+            state
+        ) VALUES (
+                     #{id},
+                     #{appName},
+                     #{appId},
+                     #{appSecret},
+                     #{createTime},
+                     #{createrNm},
+                     #{createrId},
+                     #{state}
+                 )
+    </insert>
+
+    <!-- 4. 根据 ID 查询完整对象(用于 reset/disable) -->
+    <select id="selectById" parameterType="string" resultType="cn.com.yusys.yusp.domain.entity.TabApp">
+        SELECT *
+        FROM tab_app
+        WHERE id = #{id}
+    </select>
+
+    <!-- 5. 按应用名称查询(返回 app_name, app_id, app_secret) -->
+    <select id="selectByName" parameterType="string" resultType="cn.com.yusys.yusp.domain.entity.TabApp">
+        SELECT app_name, app_id, app_secret
+        FROM tab_app
+        WHERE app_name = #{appName}
+    </select>
+
+    <!-- 6. 重置密钥:仅更新 app_secret -->
+    <update id="updateAppSecret" parameterType="map">
+        UPDATE tab_app
+        SET app_secret = #{appSecret}
+        WHERE id = #{id}
+    </update>
+
+    <!-- 7. 禁用应用:更新 state = '1' -->
+    <update id="disableApp" parameterType="string">
+        UPDATE tab_app
+        SET state = '1'
+        WHERE id = #{id}
+    </update>
+
+    <!-- 8. 全表计数(用于分页总数) -->
+    <select id="selectCountAll" resultType="java.lang.Long">
+        SELECT COUNT(*)
+        FROM tab_app
+    </select>
+
+</mapper>

+ 13 - 0
server/yusp-tagging-starter/pom.xml

@@ -117,6 +117,19 @@
                     <artifactId>spring-beans</artifactId>
                     <version>5.2.24.RELEASE</version>
                 </dependency>-->
+        <!-- MySQL JDBC Driver -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>8.0.33</version> <!-- 使用最新稳定版本 -->
+        </dependency>
+
+        <!-- HikariCP -->
+        <dependency>
+            <groupId>com.zaxxer</groupId>
+            <artifactId>HikariCP</artifactId>
+            <version>3.4.5</version> <!-- 使用最新稳定版本 -->
+        </dependency>
         <dependency>
             <groupId>org.apache.zookeeper</groupId>
             <artifactId>zookeeper</artifactId>

+ 2 - 1
server/yusp-tagging-starter/src/main/java/cn/com/yusys/yusp/detail/App.java

@@ -1,13 +1,14 @@
 package cn.com.yusys.yusp.detail;
 
 
+import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 
 @EnableDiscoveryClient
 @SpringBootApplication(scanBasePackages = {"cn.com.yusys.yusp"})
-
+@MapperScan("cn.com.yusys.yusp.mapper")
 public class App {
     public static void main(String[] args) {
         SpringApplication.run(App.class, args);

+ 51 - 2
server/yusp-tagging-starter/src/main/resources/application.yml

@@ -1,2 +1,51 @@
-server:
-  port: 8080
+spring:
+  cache:
+    type: redis #缓存类型
+  main:
+    allow-bean-definition-overriding: true
+  redis:
+    database: 0 #Redis默认情况下有16个分片,这里配置具体使用的分片,默认是0
+    host: 10.192.72.13 #Redis地址
+    port: 36379 #Redis端口
+    password: 123456 #Redis密码
+    timeout: 10000 #Redis连接超时时间
+    lettuce:
+      shutdown-timeout: 60000ms #关闭超时时间
+      pool:
+        max-active: 20 #连接池最大连接数(使用负值表示没有限制) 默认 8
+        max-wait: 10000ms #连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1
+        min-idle: 1 #连接池中的最小空闲连接 默认 0
+        max-idle: 20 #连接池中的最大空闲连接 默认 8
+  application:
+    jackson:
+      date-format: yyyy-MM-dd HH:mm:ss #日期格式
+      serialization:
+        INDENT_OUTPUT: true #是否格式化输出
+      default-property-inclusion: non_null #null不进行序列化
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver #mysql数据库连接驱动
+    type: com.zaxxer.hikari.HikariDataSource #数据库连接池类型
+    url: jdbc:mysql://10.192.72.13:6780/fjnx?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8&allowMultiQueries=true&useSSL=false #数据库地址
+    username: root #数据库用户名
+    password: 123456 #数据库密码(密文)
+    hikari:
+      minimum-idle: 1 #空闲时最小连接数
+      maximum-pool-size: 20 #连接池大小
+      connection-test-query: select 1 #连接池验证
+
+license:
+  licenseContext: <?xml version="1.0" encoding="UTF-8"?><license build-time="Fri
+    Aug 29 11:31:39 CST 2025" validate-code="FB0E39C4C5C48D85129A6FE17A9ED278">  <element
+    name="contract_code">YTEC-2024-3620-B</element>  <element name="customer_name">平台产品部研发项目-2025年</element>  <element
+    name="license_code">0000028324</element>  <element name="product_code">0000001122</element>  <element
+    name="product_name_zh-cn">宇信科技基于微服务框架统一开发平台</element>  <element name="product_name_en-us">YUSP</element>  <element
+    name="version_major">1</element>  <element name="version_sub">0</element>  <element
+    name="version_publish">1</element>  <element name="complie_date">2018-03-20</element>  <element
+    name="license_type">内部试用许可证</element>  <element name="license_start_time">2025-08-29</element>  <element
+    name="license_end_time">2026-02-20</element></license> #License 配置信息
+  licenseModel: TRIAL #License 配置信息
+management:
+  endpoints:
+    web:
+      exposure:
+        include: info,health,env,configprops,mappings,threaddump,metrics #管理节点

+ 12 - 6
server/yusp-tagging-starter/src/main/resources/bootstrap.yml

@@ -1,19 +1,25 @@
 spring:
   application:
-    name: demo
+    name: tag-server
   cloud:
     nacos:
       discovery:
-        server-addr: 127.0.0.1:38848
-        namespace: backend-base-version
+        server-addr: 10.192.72.13:38848
+        namespace: ai-tagging
       config:
-        server-addr: 127.0.0.1:38848
-        namespace: backend-base-version
+        server-addr: 10.192.72.13:38848
+        namespace: ai-tagging
         file-extension: yaml
+        username: nacos
+        password: nacos
         group: DEFAULT_GROUP
         extension-configs[0]:
-          data-id: demo.yaml
+          data-id: tag-server.yaml
           refresh: true
         extension-configs[1]:
           data-id: application-license.yml
           refresh: true #配置扩展属性动态刷新
+
+
+server:
+  port: 8080