Commit f848bead by 杨卫

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

1 parent a9fc56c7
...@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; 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; ...@@ -2,6 +2,7 @@ package com.gsc4cloud.gsc.agentmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.req.*;
import com.gsc4cloud.gsc.agentmanage.api.vo.InspectionRuleVO; import com.gsc4cloud.gsc.agentmanage.api.vo.InspectionRuleVO;
import com.gsc4cloud.gsc.common.core.util.R; import com.gsc4cloud.gsc.common.core.util.R;
...@@ -9,10 +10,7 @@ import io.swagger.v3.oas.annotations.Operation; ...@@ -9,10 +10,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
...@@ -29,28 +27,50 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -29,28 +27,50 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(description = "inspectionRule", name = "质检规则") @Tag(description = "inspectionRule", name = "质检规则")
public class InspectionRuleController { public class InspectionRuleController {
private final AgentManageRemote agentManageRemote;
@PostMapping("findPageInspectionRule") @PostMapping("findPageInspectionRule")
@Operation(summary = "质检智能体-模版列表查询") @Operation(summary = "质检智能体-规则列表查询")
public R<Page<InspectionRuleVO>> findPageInspectionRule(@RequestBody PageRequest<InspectionRuleReq> req) { 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") @PostMapping("addInspectionRule")
@Operation(summary = "质检智能体-规则新增") @Operation(summary = "质检智能体-规则新增")
public R<Boolean> addInspectionRule(@RequestBody InspectionRuleAddReq req) { 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") @PostMapping("updateInspectionRule")
@Operation(summary = "质检智能体-规则编辑") @Operation(summary = "质检智能体-规则编辑")
public R<Boolean> updateInspectionRule(@RequestBody InspectionRuleUpdReq req) { 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") @PostMapping("deleteInspectionRule")
@Operation(summary = "质检智能体-规则删除") @Operation(summary = "质检智能体-规则删除")
public R<Boolean> deleteInspectionRule(@RequestBody InspectionRuleDelReq req) { 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; ...@@ -2,6 +2,7 @@ package com.gsc4cloud.gsc.agentmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.req.*;
import com.gsc4cloud.gsc.agentmanage.api.vo.InspectionTemplateVO; import com.gsc4cloud.gsc.agentmanage.api.vo.InspectionTemplateVO;
import com.gsc4cloud.gsc.common.core.util.R; import com.gsc4cloud.gsc.common.core.util.R;
...@@ -9,10 +10,7 @@ import io.swagger.v3.oas.annotations.Operation; ...@@ -9,10 +10,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
...@@ -29,27 +27,49 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -29,27 +27,49 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(description = "inspectionTemplate", name = "质检模板") @Tag(description = "inspectionTemplate", name = "质检模板")
public class InspectionTemplateController { public class InspectionTemplateController {
private final AgentManageRemote agentManageRemote;
@PostMapping("findPageInspectionTemplate") @PostMapping("findPageInspectionTemplate")
@Operation(summary = "质检智能体-模版列表查询") @Operation(summary = "质检智能体-模版列表查询")
public R<Page<InspectionTemplateVO>> findPageInspectionTemplate(@RequestBody PageRequest<InspectionTemplateReq> req) { 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") @PostMapping("saveInspectionTemplate")
@Operation(summary = "质检智能体-模版创建") @Operation(summary = "质检智能体-模版创建")
public R<Boolean> saveInspectionTemplate(@RequestBody InspectionTemplateAddReq req) { 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") @PostMapping("deleteInspectionTemplate")
@Operation(summary = "质检智能体-模版删除") @Operation(summary = "质检智能体-模版删除")
public R<Boolean> deleteInspectionTemplate(@RequestBody InspectionTemplateDelReq req) { 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") @PostMapping("updateInspectionTemplate")
@Operation(summary = "质检智能体-模版编辑") @Operation(summary = "质检智能体-模版编辑")
public R<Boolean> updateInspectionTemplate(@RequestBody InspectionTemplateUpdReq req) { 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; ...@@ -10,10 +10,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
......
...@@ -14,10 +14,7 @@ import io.swagger.v3.oas.annotations.Operation; ...@@ -14,10 +14,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
......
...@@ -3,7 +3,6 @@ package com.gsc4cloud.gsc.agentmanage.controller; ...@@ -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.feign.agent.AgentManageRemote;
import com.gsc4cloud.gsc.agentmanage.api.req.KnowledgeCategoryAddReq; 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.KnowledgeCategoryReq;
import com.gsc4cloud.gsc.agentmanage.api.req.KnowledgeCategoryUpdReq; import com.gsc4cloud.gsc.agentmanage.api.req.KnowledgeCategoryUpdReq;
import com.gsc4cloud.gsc.agentmanage.api.vo.KnowledgeCategoryVO; import com.gsc4cloud.gsc.agentmanage.api.vo.KnowledgeCategoryVO;
...@@ -13,10 +12,7 @@ import io.swagger.v3.oas.annotations.Operation; ...@@ -13,10 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
...@@ -38,38 +34,49 @@ public class KnowledgeCategoryController { ...@@ -38,38 +34,49 @@ public class KnowledgeCategoryController {
private final AgentManageRemote agentManageRemote; private final AgentManageRemote agentManageRemote;
@PostMapping("findCategoryList") @PostMapping("findCategoryList")
@Operation(summary = "分组列表查询") @Operation(summary = "素材分组列表查询")
public R<List<KnowledgeCategoryVO>> findCategoryList(@RequestBody KnowledgeCategoryReq req) { public R<List<KnowledgeCategoryVO>> findCategoryList(@RequestBody KnowledgeCategoryReq req) {
try { try {
return agentManageRemote.findCategoryList(req); return agentManageRemote.findCategoryList(req);
} catch (Exception e) { } catch (Exception e) {
log.error("分组列表查询", e); log.error("分组列表查询异常", e);
return R.failed(e.getMessage()); return R.failed(e.getMessage());
} }
} }
@PostMapping("category") @PostMapping("updateCategory")
@Operation(summary = "分组修改") @Operation(summary = "素材分组修改")
public R<Boolean> findPageAgentInfo(@RequestBody KnowledgeCategoryUpdReq req) { public R<Boolean> updateCategory(@RequestBody KnowledgeCategoryUpdReq req) {
return null; try {
return agentManageRemote.updateCategory(req);
} catch (Exception e) {
log.error("分组修改异常", e);
return R.failed(e.getMessage());
}
} }
@PostMapping("addCategory") @PostMapping("addCategory")
@Operation(summary = "分组列表新增") @Operation(summary = "素材分组新增")
public R<Boolean> addCategory(@RequestBody KnowledgeCategoryAddReq req) { 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") @PostMapping("findCategoryWithMaterialList")
@Operation(summary = "查询分组列表包含素材") @Operation(summary = "查询分组列表包含素材")
public R<List<KnowledgeCategoryWithMaterialVO>> findCategoryWithMaterialList(@RequestBody KnowledgeCategoryReq req) { 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; ...@@ -2,16 +2,15 @@ package com.gsc4cloud.gsc.agentmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.req.*;
import com.gsc4cloud.gsc.agentmanage.api.vo.KnowledgeMaterialVO; import com.gsc4cloud.gsc.agentmanage.api.vo.KnowledgeMaterialVO;
import com.gsc4cloud.gsc.common.core.util.R; import com.gsc4cloud.gsc.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
...@@ -21,35 +20,57 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -21,35 +20,57 @@ import org.springframework.web.bind.annotation.RestController;
* @author yangwei * @author yangwei
* @since 2025-11-25 * @since 2025-11-25
*/ */
@Slf4j
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/knowledgeMaterial") @RequestMapping("/knowledgeMaterial")
@Tag(description = "knowledgeMaterial", name = "素材") @Tag(description = "knowledgeMaterial", name = "素材")
public class KnowledgeMaterialController { public class KnowledgeMaterialController {
private final AgentManageRemote agentManageRemote;
@PostMapping("findPageKnowledgeMaterial") @PostMapping("findPageKnowledgeMaterial")
@Operation(summary = "素材库列表查询分页") @Operation(summary = "素材库列表查询分页")
public R<Page<KnowledgeMaterialVO>> findPageKnowledgeMaterial(@RequestBody PageRequest<KnowledgeMaterialPageReq> req) { 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") @PostMapping("saveKnowledgeMaterial")
@Operation(summary = "素材库上传") @Operation(summary = "素材库上传")
public R<Boolean> saveKnowledgeMaterial(@RequestBody KnowledgeMaterialAddReq req) { 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") @PostMapping("updateKnowledgeMaterial")
@Operation(summary = "素材库编辑") @Operation(summary = "素材库编辑")
public R<Boolean> updateKnowledgeMaterial(@RequestBody KnowledgeMaterialUpdReq req) { 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") @PostMapping("deleteKnowledgeMaterial")
@Operation(summary = "素材库删除") @Operation(summary = "素材库删除")
public R<Boolean> deleteKnowledgeMaterial(@RequestBody KnowledgeMaterialDelReq req) { 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; 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.feign.agent.AgentManageRemote;
import com.gsc4cloud.gsc.agentmanage.api.req.LoginFormReq; 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.agentmanage.api.vo.VerifyCodeVO;
import com.gsc4cloud.gsc.common.core.util.R; import com.gsc4cloud.gsc.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import java.util.Optional;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <pre> * <pre>
...@@ -32,13 +35,24 @@ public class LoginController { ...@@ -32,13 +35,24 @@ public class LoginController {
private final AgentManageRemote agentManageRemote; 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") @PostMapping("captcha")
@Operation(summary = "获取验证码") @Operation(summary = "获取验证码")
public R<VerifyCodeVO> captcha() { public R<VerifyCodeVO> captcha() {
try { try {
return agentManageRemote.captcha(); return agentManageRemote.captcha();
} catch (Exception e) { } catch (Exception e) {
log.error("岗位助理智能体列表分页", e); log.error("获取验证码异常", e);
return R.failed(e.getMessage()); return R.failed(e.getMessage());
} }
} }
...@@ -54,4 +68,17 @@ public class LoginController { ...@@ -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; 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.ReviewAgentPromptTemplateReq;
import com.gsc4cloud.gsc.agentmanage.api.req.ReviewAgentPromptTemplateUpdReq; import com.gsc4cloud.gsc.agentmanage.api.req.ReviewAgentPromptTemplateUpdReq;
import com.gsc4cloud.gsc.agentmanage.api.vo.ReviewAgentPromptTemplateVO; import com.gsc4cloud.gsc.agentmanage.api.vo.ReviewAgentPromptTemplateVO;
...@@ -9,10 +10,7 @@ import io.swagger.v3.oas.annotations.Operation; ...@@ -9,10 +10,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
...@@ -29,17 +27,28 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -29,17 +27,28 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(description = "reviewAgentPromptTemplate", name = "复盘智能体模版提示词") @Tag(description = "reviewAgentPromptTemplate", name = "复盘智能体模版提示词")
public class ReviewAgentPromptTemplateController { public class ReviewAgentPromptTemplateController {
private final AgentManageRemote agentManageRemote;
@PostMapping("findPromptTemplate") @PostMapping("findPromptTemplate")
@Operation(summary = "复盘智能体-提示词回显") @Operation(summary = "复盘智能体-提示词回显")
public R<ReviewAgentPromptTemplateVO> findPromptTemplate(@RequestBody ReviewAgentPromptTemplateReq req) { public R<ReviewAgentPromptTemplateVO> findPromptTemplate(@RequestBody ReviewAgentPromptTemplateReq req) {
try {
return null; return agentManageRemote.findPromptTemplate(req);
} catch (Exception e) {
log.error("复盘智能体-提示词回显异常", e);
return R.failed(e.getMessage());
}
} }
@PostMapping("updatePromptTemplate") @PostMapping("updatePromptTemplate")
@Operation(summary = "复盘智能体-提示词修改") @Operation(summary = "复盘智能体-提示词修改")
public R<Boolean> updatePromptTemplate(@RequestBody ReviewAgentPromptTemplateUpdReq req) { public R<Boolean> updatePromptTemplate(@RequestBody ReviewAgentPromptTemplateUpdReq req) {
try {
return null; return agentManageRemote.updatePromptTemplate(req);
} catch (Exception e) {
log.error("复盘智能体-提示词回显异常", e);
return R.failed(e.getMessage());
}
} }
} }
package com.gsc4cloud.gsc.agentmanage.controller; package com.gsc4cloud.gsc.agentmanage.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.req.*;
import com.gsc4cloud.gsc.agentmanage.api.vo.TrainingPlanDetailVO;
import com.gsc4cloud.gsc.agentmanage.api.vo.TrainingPlanVO; import com.gsc4cloud.gsc.agentmanage.api.vo.TrainingPlanVO;
import com.gsc4cloud.gsc.common.core.util.R; import com.gsc4cloud.gsc.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p> * <p>
...@@ -28,28 +28,61 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -28,28 +28,61 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(description = "trainingPlan", name = "培训计划") @Tag(description = "trainingPlan", name = "培训计划")
public class TrainingPlanController { public class TrainingPlanController {
private final AgentManageRemote agentManageRemote;
@PostMapping("findPageTrainingPlan") @PostMapping("findPageTrainingPlan")
@Operation(summary = "培训智能体-培训岗位列表") @Operation(summary = "培训智能体-培训岗位列表")
public R<Page<TrainingPlanVO>> findPageKnowledgeMaterial(@RequestBody PageRequest<TrainingPlanPageReq> req) { public R<Page<TrainingPlanVO>> findPageTrainingPlan(@RequestBody PageRequest<TrainingPlanPageReq> req) {
return null; try {
return agentManageRemote.findPageTrainingPlan(req);
} catch (Exception e) {
log.error("培训智能体-培训岗位列表异常", e);
return R.failed(e.getMessage());
}
} }
@PostMapping("addTrainingPlan") @PostMapping("addTrainingPlan")
@Operation(summary = "培训智能体-培训计划新增") @Operation(summary = "培训智能体-培训计划新增")
public R<Boolean> addTrainingPlan(@RequestBody TrainingPlanAddReq req) { 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") @PostMapping("deleteTrainingPlan")
@Operation(summary = "培训智能体-培训计划删除") @Operation(summary = "培训智能体-培训计划删除")
public R<Boolean> deleteTrainingPlan(@RequestBody TrainingPlanDelReq req) { 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") @PostMapping("updateTrainingPlan")
@Operation(summary = "培训智能体-培训计划修改") @Operation(summary = "培训智能体-培训计划修改")
public R<Boolean> updateTrainingPlan(@RequestBody TrainingPlanUpdReq req) { 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!