Commit f848bead by 杨卫

feat:1047089:智能体登录加密+接口开发

1 parent a9fc56c7
......@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
......
package com.gsc4cloud.gsc.agentmanage.controller;
import com.gsc4cloud.gsc.agentmanage.api.feign.agent.AgentManageRemote;
import com.gsc4cloud.gsc.agentmanage.api.req.KnowledgeCategoryForGeneralReq;
import com.gsc4cloud.gsc.agentmanage.api.vo.KnowledgeCategoryWithMaterialVO;
import com.gsc4cloud.gsc.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 通用知识分类
* </p>
*
* @author yangwei
* @since 2025-11-25
*/
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/generalKnowledgeCategory")
@Tag(description = "generalKnowledgeCategory", name = "通用知识分类")
public class GeneralKnowledgeCategoryController {
private final AgentManageRemote agentManageRemote;
@PostMapping("findCategoryWithGeneralKnowledgeList")
@Operation(summary = "通用知识分类")
public R<List<KnowledgeCategoryWithMaterialVO>> findCategoryWithGeneralKnowledgeList(@RequestBody KnowledgeCategoryForGeneralReq req) {
try {
return agentManageRemote.findCategoryWithGeneralKnowledgeList(req);
} catch (Exception e) {
log.error("通用知识分类列表查询异常", e);
return R.failed(e.getMessage());
}
}
}
......@@ -2,6 +2,7 @@ package com.gsc4cloud.gsc.agentmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.agentmanage.api.feign.agent.AgentManageRemote;
import com.gsc4cloud.gsc.agentmanage.api.req.*;
import com.gsc4cloud.gsc.agentmanage.api.vo.InspectionRuleVO;
import com.gsc4cloud.gsc.common.core.util.R;
......@@ -9,10 +10,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* <p>
......@@ -29,28 +27,50 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(description = "inspectionRule", name = "质检规则")
public class InspectionRuleController {
private final AgentManageRemote agentManageRemote;
@PostMapping("findPageInspectionRule")
@Operation(summary = "质检智能体-模版列表查询")
@Operation(summary = "质检智能体-规则列表查询")
public R<Page<InspectionRuleVO>> findPageInspectionRule(@RequestBody PageRequest<InspectionRuleReq> req) {
return null;
try {
return agentManageRemote.findPageInspectionRule(req);
} catch (Exception e) {
log.error("质检智能体-规则列表查询分页异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("addInspectionRule")
@Operation(summary = "质检智能体-规则新增")
public R<Boolean> addInspectionRule(@RequestBody InspectionRuleAddReq req) {
return null;
try {
return agentManageRemote.addInspectionRule(req);
} catch (Exception e) {
log.error("质检智能体-规则新增异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("updateInspectionRule")
@Operation(summary = "质检智能体-规则编辑")
public R<Boolean> updateInspectionRule(@RequestBody InspectionRuleUpdReq req) {
return null;
try {
return agentManageRemote.updateInspectionRule(req);
} catch (Exception e) {
log.error("质检智能体-规则编辑异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("deleteInspectionRule")
@Operation(summary = "质检智能体-规则删除")
public R<Boolean> deleteInspectionRule(@RequestBody InspectionRuleDelReq req) {
return null;
try {
return agentManageRemote.deleteInspectionRule(req);
} catch (Exception e) {
log.error("质检智能体-规则编辑异常", e);
return R.failed(e.getMessage());
}
}
......
......@@ -2,6 +2,7 @@ package com.gsc4cloud.gsc.agentmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.agentmanage.api.feign.agent.AgentManageRemote;
import com.gsc4cloud.gsc.agentmanage.api.req.*;
import com.gsc4cloud.gsc.agentmanage.api.vo.InspectionTemplateVO;
import com.gsc4cloud.gsc.common.core.util.R;
......@@ -9,10 +10,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* <p>
......@@ -29,27 +27,49 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(description = "inspectionTemplate", name = "质检模板")
public class InspectionTemplateController {
private final AgentManageRemote agentManageRemote;
@PostMapping("findPageInspectionTemplate")
@Operation(summary = "质检智能体-模版列表查询")
public R<Page<InspectionTemplateVO>> findPageInspectionTemplate(@RequestBody PageRequest<InspectionTemplateReq> req) {
return null;
try {
return agentManageRemote.findPageInspectionTemplate(req);
} catch (Exception e) {
log.error("质检智能体-模版列表查询异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("saveInspectionTemplate")
@Operation(summary = "质检智能体-模版创建")
public R<Boolean> saveInspectionTemplate(@RequestBody InspectionTemplateAddReq req) {
return null;
try {
return agentManageRemote.saveInspectionTemplate(req);
} catch (Exception e) {
log.error("质检智能体-模版创建异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("deleteInspectionTemplate")
@Operation(summary = "质检智能体-模版删除")
public R<Boolean> deleteInspectionTemplate(@RequestBody InspectionTemplateDelReq req) {
return null;
try {
return agentManageRemote.deleteInspectionTemplate(req);
} catch (Exception e) {
log.error("质检智能体-模版删除异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("updateInspectionTemplate")
@Operation(summary = "质检智能体-模版编辑")
public R<Boolean> updateInspectionTemplate(@RequestBody InspectionTemplateUpdReq req) {
return null;
try {
return agentManageRemote.updateInspectionTemplate(req);
} catch (Exception e) {
log.error("质检智能体-模版编辑异常", e);
return R.failed(e.getMessage());
}
}
}
......@@ -10,10 +10,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* <p>
......
......@@ -14,10 +14,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* <p>
......
......@@ -3,7 +3,6 @@ package com.gsc4cloud.gsc.agentmanage.controller;
import com.gsc4cloud.gsc.agentmanage.api.feign.agent.AgentManageRemote;
import com.gsc4cloud.gsc.agentmanage.api.req.KnowledgeCategoryAddReq;
import com.gsc4cloud.gsc.agentmanage.api.req.KnowledgeCategoryAssignDeptReq;
import com.gsc4cloud.gsc.agentmanage.api.req.KnowledgeCategoryReq;
import com.gsc4cloud.gsc.agentmanage.api.req.KnowledgeCategoryUpdReq;
import com.gsc4cloud.gsc.agentmanage.api.vo.KnowledgeCategoryVO;
......@@ -13,10 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
......@@ -38,38 +34,49 @@ public class KnowledgeCategoryController {
private final AgentManageRemote agentManageRemote;
@PostMapping("findCategoryList")
@Operation(summary = "分组列表查询")
@Operation(summary = "素材分组列表查询")
public R<List<KnowledgeCategoryVO>> findCategoryList(@RequestBody KnowledgeCategoryReq req) {
try {
return agentManageRemote.findCategoryList(req);
} catch (Exception e) {
log.error("分组列表查询", e);
log.error("分组列表查询异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("category")
@Operation(summary = "分组修改")
public R<Boolean> findPageAgentInfo(@RequestBody KnowledgeCategoryUpdReq req) {
return null;
@PostMapping("updateCategory")
@Operation(summary = "素材分组修改")
public R<Boolean> updateCategory(@RequestBody KnowledgeCategoryUpdReq req) {
try {
return agentManageRemote.updateCategory(req);
} catch (Exception e) {
log.error("分组修改异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("addCategory")
@Operation(summary = "分组列表新增")
@Operation(summary = "素材分组新增")
public R<Boolean> addCategory(@RequestBody KnowledgeCategoryAddReq req) {
return null;
try {
return agentManageRemote.addCategory(req);
} catch (Exception e) {
log.error("素材分组新增异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("findCategoryWithMaterialList")
@Operation(summary = "查询分组列表包含素材")
public R<List<KnowledgeCategoryWithMaterialVO>> findCategoryWithMaterialList(@RequestBody KnowledgeCategoryReq req) {
return null;
try {
return agentManageRemote.findCategoryWithMaterialList(req);
} catch (Exception e) {
log.error("查询分组列表包含素材异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("findAssignDeptCategoryWithMaterialList")
@Operation(summary = "查询指定部门下分组列表包含素材")
public R<List<KnowledgeCategoryWithMaterialVO>> findAssignDeptCategoryWithMaterialList(@RequestBody KnowledgeCategoryAssignDeptReq req) {
return null;
}
}
......@@ -2,16 +2,15 @@ package com.gsc4cloud.gsc.agentmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.agentmanage.api.feign.agent.AgentManageRemote;
import com.gsc4cloud.gsc.agentmanage.api.req.*;
import com.gsc4cloud.gsc.agentmanage.api.vo.KnowledgeMaterialVO;
import com.gsc4cloud.gsc.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
/**
* <p>
......@@ -21,35 +20,57 @@ import org.springframework.web.bind.annotation.RestController;
* @author yangwei
* @since 2025-11-25
*/
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/knowledgeMaterial")
@Tag(description = "knowledgeMaterial", name = "素材")
public class KnowledgeMaterialController {
private final AgentManageRemote agentManageRemote;
@PostMapping("findPageKnowledgeMaterial")
@Operation(summary = "素材库列表查询分页")
public R<Page<KnowledgeMaterialVO>> findPageKnowledgeMaterial(@RequestBody PageRequest<KnowledgeMaterialPageReq> req) {
return null;
try {
return agentManageRemote.findPageKnowledgeMaterial(req);
} catch (Exception e) {
log.error("素材库列表查询分页异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("saveKnowledgeMaterial")
@Operation(summary = "素材库上传")
public R<Boolean> saveKnowledgeMaterial(@RequestBody KnowledgeMaterialAddReq req) {
return null;
try {
return agentManageRemote.saveKnowledgeMaterial(req);
} catch (Exception e) {
log.error("素材库上传异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("updateKnowledgeMaterial")
@Operation(summary = "素材库编辑")
public R<Boolean> updateKnowledgeMaterial(@RequestBody KnowledgeMaterialUpdReq req) {
return null;
try {
return agentManageRemote.updateKnowledgeMaterial(req);
} catch (Exception e) {
log.error("素材库编辑异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("deleteKnowledgeMaterial")
@Operation(summary = "素材库删除")
public R<Boolean> deleteKnowledgeMaterial(@RequestBody KnowledgeMaterialDelReq req) {
return null;
try {
return agentManageRemote.deleteKnowledgeMaterial(req);
} catch (Exception e) {
log.error("素材库删除异常", e);
return R.failed(e.getMessage());
}
}
}
package com.gsc4cloud.gsc.agentmanage.controller;
import cn.hutool.core.bean.BeanUtil;
import com.gsc4cloud.gsc.agentmanage.api.feign.agent.AgentManageRemote;
import com.gsc4cloud.gsc.agentmanage.api.req.LoginFormReq;
import com.gsc4cloud.gsc.agentmanage.api.util.UserContext;
import com.gsc4cloud.gsc.agentmanage.api.vo.LoginUserVO;
import com.gsc4cloud.gsc.agentmanage.api.vo.VerifyCodeVO;
import com.gsc4cloud.gsc.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Optional;
/**
* <pre>
......@@ -32,13 +35,24 @@ public class LoginController {
private final AgentManageRemote agentManageRemote;
@PostMapping("publicKey")
@Operation(summary = "获取加密公钥")
public R<String> getPublicKey() {
try {
return agentManageRemote.getPublicKey();
} catch (Exception e) {
log.error("获取公钥异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("captcha")
@Operation(summary = "获取验证码")
public R<VerifyCodeVO> captcha() {
try {
return agentManageRemote.captcha();
} catch (Exception e) {
log.error("岗位助理智能体列表分页", e);
log.error("获取验证码异常", e);
return R.failed(e.getMessage());
}
}
......@@ -54,4 +68,17 @@ public class LoginController {
}
}
@PostMapping("/currLoginUser")
@Operation(summary = "获取当前登录用户信息")
public R<LoginUserVO> getLoginUser() {
try {
LoginUserVO loginUserVO = Optional.ofNullable(UserContext.getUser())
.map(user -> BeanUtil.copyProperties(user, LoginUserVO.class))
.orElseThrow(() -> new RuntimeException("用户未登录"));
return R.ok(loginUserVO);
} catch (Exception e) {
log.error("获取当前登录用户信息异常", e);
return R.failed(e.getMessage());
}
}
}
package com.gsc4cloud.gsc.agentmanage.controller;
import com.gsc4cloud.gsc.agentmanage.api.feign.agent.AgentManageRemote;
import com.gsc4cloud.gsc.agentmanage.api.req.ReviewAgentPromptTemplateReq;
import com.gsc4cloud.gsc.agentmanage.api.req.ReviewAgentPromptTemplateUpdReq;
import com.gsc4cloud.gsc.agentmanage.api.vo.ReviewAgentPromptTemplateVO;
......@@ -9,10 +10,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* <p>
......@@ -29,17 +27,28 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(description = "reviewAgentPromptTemplate", name = "复盘智能体模版提示词")
public class ReviewAgentPromptTemplateController {
private final AgentManageRemote agentManageRemote;
@PostMapping("findPromptTemplate")
@Operation(summary = "复盘智能体-提示词回显")
public R<ReviewAgentPromptTemplateVO> findPromptTemplate(@RequestBody ReviewAgentPromptTemplateReq req) {
return null;
try {
return agentManageRemote.findPromptTemplate(req);
} catch (Exception e) {
log.error("复盘智能体-提示词回显异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("updatePromptTemplate")
@Operation(summary = "复盘智能体-提示词修改")
public R<Boolean> updatePromptTemplate(@RequestBody ReviewAgentPromptTemplateUpdReq req) {
return null;
try {
return agentManageRemote.updatePromptTemplate(req);
} catch (Exception e) {
log.error("复盘智能体-提示词回显异常", e);
return R.failed(e.getMessage());
}
}
}
package com.gsc4cloud.gsc.agentmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.agentmanage.api.feign.agent.AgentManageRemote;
import com.gsc4cloud.gsc.agentmanage.api.req.*;
import com.gsc4cloud.gsc.agentmanage.api.vo.TrainingPlanDetailVO;
import com.gsc4cloud.gsc.agentmanage.api.vo.TrainingPlanVO;
import com.gsc4cloud.gsc.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* <p>
......@@ -28,28 +28,61 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(description = "trainingPlan", name = "培训计划")
public class TrainingPlanController {
private final AgentManageRemote agentManageRemote;
@PostMapping("findPageTrainingPlan")
@Operation(summary = "培训智能体-培训岗位列表")
public R<Page<TrainingPlanVO>> findPageKnowledgeMaterial(@RequestBody PageRequest<TrainingPlanPageReq> req) {
return null;
public R<Page<TrainingPlanVO>> findPageTrainingPlan(@RequestBody PageRequest<TrainingPlanPageReq> req) {
try {
return agentManageRemote.findPageTrainingPlan(req);
} catch (Exception e) {
log.error("培训智能体-培训岗位列表异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("addTrainingPlan")
@Operation(summary = "培训智能体-培训计划新增")
public R<Boolean> addTrainingPlan(@RequestBody TrainingPlanAddReq req) {
return null;
try {
return agentManageRemote.addTrainingPlan(req);
} catch (Exception e) {
log.error("培训智能体-培训计划新增异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("deleteTrainingPlan")
@Operation(summary = "培训智能体-培训计划删除")
public R<Boolean> deleteTrainingPlan(@RequestBody TrainingPlanDelReq req) {
return null;
try {
return agentManageRemote.deleteTrainingPlan(req);
} catch (Exception e) {
log.error("培训智能体-培训计划删除异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("updateTrainingPlan")
@Operation(summary = "培训智能体-培训计划修改")
public R<Boolean> updateTrainingPlan(@RequestBody TrainingPlanUpdReq req) {
return null;
try {
return agentManageRemote.updateTrainingPlan(req);
} catch (Exception e) {
log.error("培训智能体-培训计划修改异常", e);
return R.failed(e.getMessage());
}
}
@PostMapping("findTrainingPlanDetail/{planId}")
@Operation(summary = "培训智能体-岗位培训计划详情")
public R<TrainingPlanDetailVO> findTrainingPlanDetail(@PathVariable("planId") @Parameter(description = "培训计划ID") Long planId) {
try {
return agentManageRemote.findTrainingPlanDetail(planId);
} catch (Exception e) {
log.error("培训智能体-培训岗位列表异常", e);
return R.failed(e.getMessage());
}
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!