Browse Source

add:标注功能

zhongwei
luyie 3 months ago
parent
commit
625cc28bf3
  1. 61
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/AgentLogController.java
  2. 50
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/AgentLogEntity.java
  3. 11
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/mapper/AgentLogMapper.java
  4. 11
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/AgentLogService.java
  5. 22
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/AgentLogServiceImpl.java

61
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/AgentLogController.java

@ -0,0 +1,61 @@
package com.hnac.hzims.bigmodel.maintenance.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.bigmodel.maintenance.entity.AgentLogEntity;
import com.hnac.hzims.bigmodel.maintenance.service.AgentLogService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
/**
* @Author: ypj
* @Date: 2024/9/9 10:37
*/
@RestController
@Slf4j
@AllArgsConstructor
public class AgentLogController {
private final AgentLogService agentLogService;
@GetMapping("/listPage")
@ApiOperation(value = "分页查询")
@ApiOperationSupport(order = 1)
public R<IPage<AgentLogEntity>> listPage(Query query, AgentLogEntity req) {
return R.data(agentLogService.page(Condition.getPage(query), Condition.getQueryWrapper(new AgentLogEntity(), req)));
}
@GetMapping("/detail")
@ApiOperation(value = "查看详情")
@ApiOperationSupport(order = 2)
public R<AgentLogEntity> detail(@RequestParam @ApiParam("主键ID") Long id) {
return R.data(agentLogService.getById(id));
}
@PostMapping("/save")
@ApiOperation(value = "保存")
@ApiOperationSupport(order = 3)
public R save(@RequestParam AgentLogEntity req) {
return R.status(agentLogService.save(req));
}
@DeleteMapping("/remove")
@ApiOperation(value = "删除")
@ApiOperationSupport(order = 4)
public R remove(@RequestParam @ApiParam("主键ID,按逗号分隔") String ids) {
return R.status(agentLogService.removeByIds(Func.toLongList(",", ids)));
}
@PutMapping("/update")
@ApiOperation(value = "编辑")
@ApiOperationSupport(order = 5)
public R update(@RequestBody AgentLogEntity req) {
return R.status(agentLogService.updateById(req));
}
}

50
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/AgentLogEntity.java

@ -0,0 +1,50 @@
package com.hnac.hzims.bigmodel.maintenance.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serializable;
/**
* @Author: ypj
* @Date: 2024/9/9 10:38
*/
@ApiModel("问题标注")
@TableName("agent_log")
@Data
public class AgentLogEntity extends TenantEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("对话id")
@TableField("CHAT_ID")
private String chatId;
@ApiModelProperty("问题id")
@TableField("Q_ID")
private String qId;
@ApiModelProperty("问题来源")
private String agent;
@ApiModelProperty("问题")
private String q;
@ApiModelProperty("答案")
private String a;
@ApiModelProperty("答案类型")
private String aType;
@ApiModelProperty("用户结论,0为错误,1为正确")
private int userConclusion;
@ApiModelProperty("标注状态,0为未标注,1为已标注")
private int labelStatus;
@ApiModelProperty("标注内容,json字符串,答案类型不一样格式不一样")
private String labelContent;
}

11
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/mapper/AgentLogMapper.java

@ -0,0 +1,11 @@
package com.hnac.hzims.bigmodel.maintenance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.bigmodel.maintenance.entity.AgentLogEntity;
/**
* @Author: ypj
* @Date: 2024/9/9 11:07
*/
public interface AgentLogMapper extends BaseMapper<AgentLogEntity> {
}

11
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/AgentLogService.java

@ -0,0 +1,11 @@
package com.hnac.hzims.bigmodel.maintenance.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.bigmodel.maintenance.entity.AgentLogEntity;
/**
* @Author: ypj
* @Date: 2024/9/9 11:08
*/
public interface AgentLogService extends IService<AgentLogEntity> {
}

22
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/AgentLogServiceImpl.java

@ -0,0 +1,22 @@
package com.hnac.hzims.bigmodel.maintenance.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.bigmodel.maintenance.entity.AgentLogEntity;
import com.hnac.hzims.bigmodel.maintenance.mapper.AgentLogMapper;
import com.hnac.hzims.bigmodel.maintenance.service.AgentLogService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @Author: ypj
* @Date: 2024/9/9 11:10
*/
@Service
@Slf4j
@AllArgsConstructor
@DS("hznlm")
public class AgentLogServiceImpl extends ServiceImpl<AgentLogMapper, AgentLogEntity> implements AgentLogService {
}
Loading…
Cancel
Save