1.修改获取开场白接口的返回结构
2.添加获取评论接口
This commit is contained in:
@@ -2,9 +2,11 @@ package com.yupi.springbootinit.controller;
|
||||
|
||||
import com.yupi.springbootinit.common.BaseResponse;
|
||||
import com.yupi.springbootinit.common.ResultUtils;
|
||||
import com.yupi.springbootinit.model.entity.AiComment;
|
||||
import com.yupi.springbootinit.model.entity.AiTemplate;
|
||||
import com.yupi.springbootinit.model.vo.common.AccountCrawlCount;
|
||||
import com.yupi.springbootinit.model.vo.country.CountryInfoVO;
|
||||
import com.yupi.springbootinit.service.AiCommentService;
|
||||
import com.yupi.springbootinit.service.AiTemplateService;
|
||||
import com.yupi.springbootinit.service.CommonService;
|
||||
import com.yupi.springbootinit.service.CountryInfoService;
|
||||
@@ -34,6 +36,9 @@ public class CommonController {
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
|
||||
@Resource
|
||||
private AiCommentService aiCommentService;
|
||||
|
||||
@PostMapping("country_info")
|
||||
public BaseResponse<List<CountryInfoVO>> countryInfo() {
|
||||
|
||||
@@ -48,10 +53,20 @@ public class CommonController {
|
||||
@GetMapping("prologue")
|
||||
public BaseResponse<List<String>> getPrologue(){
|
||||
List<AiTemplate> list = aiTemplateService.list();
|
||||
ArrayList<String> strings = new ArrayList<>();
|
||||
ArrayList<String> prologueList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
strings.add(item.getContent());
|
||||
prologueList.add(item.getContent());
|
||||
});
|
||||
return ResultUtils.success(strings);
|
||||
return ResultUtils.success(prologueList);
|
||||
}
|
||||
|
||||
@GetMapping("comment")
|
||||
public BaseResponse<List<String>> getComment(){
|
||||
List<AiComment> list = aiCommentService.list();
|
||||
ArrayList<String> commentList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
commentList.add(item.getContent());
|
||||
});
|
||||
return ResultUtils.success(commentList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.yupi.springbootinit.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yupi.springbootinit.model.entity.AiComment;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/7/23 16:00
|
||||
*/
|
||||
|
||||
public interface AiCommentMapper extends BaseMapper<AiComment> {
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.yupi.springbootinit.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/7/23 16:00
|
||||
*/
|
||||
|
||||
@ApiModel(description="ai_comment")
|
||||
@Data
|
||||
@TableName(value = "ai_comment")
|
||||
public class AiComment {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
@ApiModelProperty(value="主键")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 具体评论
|
||||
*/
|
||||
@TableField(value = "content")
|
||||
@ApiModelProperty(value="具体评论")
|
||||
private String content;
|
||||
}
|
||||
@@ -24,13 +24,6 @@ public class AiTemplate {
|
||||
@ApiModelProperty(value="主键")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 语言
|
||||
*/
|
||||
@TableField(value = "`language`")
|
||||
@ApiModelProperty(value="语言")
|
||||
private String language;
|
||||
|
||||
/**
|
||||
* 具体话术
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.yupi.springbootinit.service;
|
||||
|
||||
import com.yupi.springbootinit.model.entity.AiComment;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/7/23 16:00
|
||||
*/
|
||||
|
||||
public interface AiCommentService extends IService<AiComment>{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.yupi.springbootinit.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yupi.springbootinit.model.entity.AiComment;
|
||||
import com.yupi.springbootinit.mapper.AiCommentMapper;
|
||||
import com.yupi.springbootinit.service.AiCommentService;
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/7/23 16:00
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class AiCommentServiceImpl extends ServiceImpl<AiCommentMapper, AiComment> implements AiCommentService{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user