Browse Source

add:大模型向量参数配置

zhongwei
luyie 3 months ago
parent
commit
dca3b894c2
  1. 64
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/VectorParamController.java
  2. 35
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/VectorParamEntity.java
  3. 11
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/mapper/VectorParamMapper.java
  4. 13
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/VectorParamService.java
  5. 13
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java

64
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/controller/VectorParamController.java

@ -0,0 +1,64 @@
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.VectorParamEntity;
import com.hnac.hzims.bigmodel.maintenance.service.VectorParamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
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/2 16:10
*/
@RestController
@RequestMapping("/vector/")
@Api(value = "向量参数配置", tags = "向量参数配置")
@AllArgsConstructor
public class VectorParamController {
private final VectorParamService vectorParamService;
@GetMapping("/listPage")
@ApiOperation(value = "分页查询")
@ApiOperationSupport(order = 1)
public R<IPage<VectorParamEntity>> listPage(Query query, VectorParamEntity req) {
return R.data(vectorParamService.page(Condition.getPage(query), Condition.getQueryWrapper(req).lambda()));
}
@GetMapping("/detail")
@ApiOperation(value = "查看详情")
@ApiOperationSupport(order = 2)
public R<VectorParamEntity> detail(@RequestParam @ApiParam("主键ID") Long id) {
return R.data(vectorParamService.getById(id));
}
@PostMapping("/save")
@ApiOperation(value = "保存向量参数配置")
@ApiOperationSupport(order = 3)
public R save(@RequestBody VectorParamEntity req) {
return R.status(vectorParamService.save(req));
}
@DeleteMapping("/remove")
@ApiOperation(value = "删除向量参数配置")
@ApiOperationSupport(order = 4)
public R remove(@RequestParam @ApiParam("主键ID,按逗号分隔") String ids) {
return R.status(vectorParamService.removeByIds(Func.toLongList(",",ids)));
}
@PutMapping("/update")
@ApiOperation(value = "编辑向量参数配置")
@ApiOperationSupport(order = 5)
public R update(@RequestBody VectorParamEntity req) {
return R.status(vectorParamService.updateById(req));
}
}

35
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/entity/VectorParamEntity.java

@ -0,0 +1,35 @@
package com.hnac.hzims.bigmodel.maintenance.entity;
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/2 14:54
*/
@ApiModel("向量参数配置")
@TableName("HZIMS_VECTOR_PARAM")
@Data
public class VectorParamEntity extends TenantEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("参数名称")
private String name;
@ApiModelProperty("url")
private String url;
@ApiModelProperty("项目前缀")
private String projectPrefix;
@ApiModelProperty("数据库表名")
private String tableName;
@ApiModelProperty("向量键值对,json格式")
private String attributeMap;
}

11
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/mapper/VectorParamMapper.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.VectorParamEntity;
/**
* @Author: ypj
* @Date: 2024/09/02 15:12
*/
public interface VectorParamMapper extends BaseMapper<VectorParamEntity> {
}

13
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/VectorParamService.java

@ -0,0 +1,13 @@
package com.hnac.hzims.bigmodel.maintenance.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hnac.hzims.bigmodel.maintenance.entity.VectorParamEntity;
/**
* @Author: ypj
* @Date: 2024/09/02 15:11
*/
public interface VectorParamService extends IService<VectorParamEntity> {
}

13
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java

@ -0,0 +1,13 @@
package com.hnac.hzims.bigmodel.maintenance.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.bigmodel.maintenance.entity.VectorParamEntity;
import com.hnac.hzims.bigmodel.maintenance.mapper.VectorParamMapper;
import com.hnac.hzims.bigmodel.maintenance.service.VectorParamService;
/**
* @Author: ypj
* @Date: 2024/9/2 16:14
*/
public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, VectorParamEntity> implements VectorParamService {
}
Loading…
Cancel
Save