定义chat role 接口

This commit is contained in:
cherishsince 2024-04-11 21:52:14 +08:00
parent 1ea94d9245
commit 687eef95b6
8 changed files with 249 additions and 0 deletions

View File

@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.ai.controller.app;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.ai.controller.app.vo.*;
import cn.iocoder.yudao.module.ai.service.ChatRoleService;
import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* ai chat 角色
*
* @fansili
* @since v1.0
*/
@RestController
@RequestMapping("/chat-role")
@AllArgsConstructor
public class AiChatRoleController {
private final ChatRoleService chatRoleService;
@Operation(summary = "chat角色 - 角色列表")
@GetMapping("/list")
public CommonResult<ChatRoleListRes> list(@Validated @ModelAttribute ChatRoleListReq req) {
return chatRoleService.list(req);
}
@Operation(summary = "chat角色 - 添加")
@PutMapping("/add")
public CommonResult<Void> add(@Validated @RequestBody ChatRoleAddReq req) {
chatRoleService.add(req);
return CommonResult.success(null);
}
@Operation(summary = "chat角色 - 修改")
@PostMapping("/update")
public CommonResult<Void> update(@Validated @RequestBody ChatRoleUpdateReq req) {
chatRoleService.update(req);
return CommonResult.success(null);
}
@Operation(summary = "chat角色 - 修改可见性")
@PostMapping("/update-visibility")
public CommonResult<Void> updateVisibility(@Validated @RequestBody ChatRoleUpdateVisibilityReq req) {
chatRoleService.updateVisibility(req);
return CommonResult.success(null);
}
@Operation(summary = "chat角色 - 修改可见性")
@DeleteMapping("/delete")
public CommonResult<Void> delete(@RequestParam("chatRoleId") Long chatRoleId) {
chatRoleService.delete(chatRoleId);
return CommonResult.success(null);
}
}

View File

@ -0,0 +1,20 @@
package cn.iocoder.yudao.module.ai.controller.app.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* chat 角色列表
*
* @fansili
* @since v1.0
*/
@Data
@Accessors(chain = true)
public class ChatRoleAddReq extends PageParam {
@Schema(description = "查询")
private String search;
}

View File

@ -0,0 +1,20 @@
package cn.iocoder.yudao.module.ai.controller.app.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* chat 角色列表
*
* @fansili
* @since v1.0
*/
@Data
@Accessors(chain = true)
public class ChatRoleListReq extends PageParam {
@Schema(description = "查询")
private String search;
}

View File

@ -0,0 +1,15 @@
package cn.iocoder.yudao.module.ai.controller.app.vo;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* chat 角色列表
*
* @fansili
* @since v1.0
*/
@Data
@Accessors(chain = true)
public class ChatRoleListRes {
}

View File

@ -0,0 +1,20 @@
package cn.iocoder.yudao.module.ai.controller.app.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* chat 角色 - 更新
*
* @fansili
* @since v1.0
*/
@Data
@Accessors(chain = true)
public class ChatRoleUpdateReq extends PageParam {
@Schema(description = "查询")
private String search;
}

View File

@ -0,0 +1,20 @@
package cn.iocoder.yudao.module.ai.controller.app.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* chat 角色 - 修改可见性
*
* @fansili
* @since v1.0
*/
@Data
@Accessors(chain = true)
public class ChatRoleUpdateVisibilityReq extends PageParam {
@Schema(description = "查询")
private String search;
}

View File

@ -0,0 +1,52 @@
package cn.iocoder.yudao.module.ai.service;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.ai.controller.app.vo.*;
/**
* chat 角色
*
* @fansili
* @since v1.0
*/
public interface ChatRoleService {
/**
* 获取聊天角色列表
*
* @param req
* @return
*/
CommonResult<ChatRoleListRes> list(ChatRoleListReq req);
/**
* chat角色 - 添加
*
* @param req
* @return
*/
ChatRoleListRes add(ChatRoleAddReq req);
/**
* chat角色 - 修改
*
* @param req
*/
void update(ChatRoleUpdateReq req);
/**
* chat角色 - 修改可见性
*
* @param req
*/
void updateVisibility(ChatRoleUpdateVisibilityReq req);
/**
* chat角色 - 删除
*
* @param chatRoleId
*/
void delete(Long chatRoleId);
}

View File

@ -0,0 +1,45 @@
package cn.iocoder.yudao.module.ai.service;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.ai.controller.app.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* chat 角色
*
* @fansili
* @since v1.0
*/
@Service
@AllArgsConstructor
@Slf4j
public class ChatRoleServiceImpl implements ChatRoleService {
@Override
public CommonResult<ChatRoleListRes> list(ChatRoleListReq req) {
return null;
}
@Override
public ChatRoleListRes add(ChatRoleAddReq req) {
return null;
}
@Override
public void update(ChatRoleUpdateReq req) {
}
@Override
public void updateVisibility(ChatRoleUpdateVisibilityReq req) {
}
@Override
public void delete(Long chatRoleId) {
}
}