主播信息入库添加 userId 字段,添加国家信息接口
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.yupi.springbootinit.controller;
|
||||
|
||||
import com.yupi.springbootinit.common.BaseResponse;
|
||||
import com.yupi.springbootinit.common.ResultUtils;
|
||||
import com.yupi.springbootinit.model.vo.country.CountryInfoVO;
|
||||
import com.yupi.springbootinit.service.CountryInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/6/13 13:44
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common")
|
||||
@Slf4j
|
||||
@CrossOrigin
|
||||
public class CommonController {
|
||||
|
||||
@Resource
|
||||
private CountryInfoService countryInfoService;
|
||||
|
||||
@PostMapping("country_info")
|
||||
public BaseResponse<List<CountryInfoVO>> countryInfo() {
|
||||
|
||||
return ResultUtils.success(countryInfoService.getCountryList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.yupi.springbootinit.mapper;
|
||||
import com.yupi.springbootinit.model.vo.country.CountryInfoVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yupi.springbootinit.model.entity.CountryInfo;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/6/13 13:58
|
||||
*/
|
||||
|
||||
public interface CountryInfoMapper extends BaseMapper<CountryInfo> {
|
||||
|
||||
List<CountryInfoVO> selectByCountryGroupName();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
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 java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/6/13 13:58
|
||||
*/
|
||||
|
||||
/**
|
||||
* 国家与地区信息统计
|
||||
*/
|
||||
@ApiModel(description = "国家与地区信息统计")
|
||||
@Data
|
||||
@TableName(value = "country_info")
|
||||
public class CountryInfo {
|
||||
/**
|
||||
* 主键id,无业务含义
|
||||
*/
|
||||
@ApiModelProperty(value = "主键id,无业务含义")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 国家id
|
||||
*/
|
||||
@TableId(value = "country_id", type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "国家id")
|
||||
private String countryId;
|
||||
|
||||
/**
|
||||
* 业务区与地区码
|
||||
*/
|
||||
@TableField(value = "country_group")
|
||||
@ApiModelProperty(value = "业务区与地区码")
|
||||
private String countryGroup;
|
||||
|
||||
/**
|
||||
* 业务区与地区名称
|
||||
*/
|
||||
@TableField(value = "country_group_name")
|
||||
@ApiModelProperty(value = "业务区与地区名称")
|
||||
private String countryGroupName;
|
||||
|
||||
/**
|
||||
* 国家名称
|
||||
*/
|
||||
@TableField(value = "country_name")
|
||||
@ApiModelProperty(value = "国家名称")
|
||||
private String countryName;
|
||||
|
||||
/**
|
||||
* 语言
|
||||
*/
|
||||
@TableField(value = "`language`")
|
||||
@ApiModelProperty(value = "语言")
|
||||
private String language;
|
||||
|
||||
/**
|
||||
* 语言中文
|
||||
*/
|
||||
@TableField(value = "language_name")
|
||||
@ApiModelProperty(value = "语言中文")
|
||||
private String languageName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "create_time")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@TableField(value = "creator")
|
||||
@ApiModelProperty(value = "创建人id")
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "update_time")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 更新人id
|
||||
*/
|
||||
@TableField(value = "updater")
|
||||
@ApiModelProperty(value = "更新人id")
|
||||
private String updater;
|
||||
}
|
||||
@@ -72,6 +72,11 @@ public class NewHosts {
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 用户 Id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 入库人
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.yupi.springbootinit.model.vo.country;
|
||||
|
||||
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;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/6/13 13:58
|
||||
*/
|
||||
|
||||
/**
|
||||
* 国家与地区信息统计
|
||||
*/
|
||||
@ApiModel(description = "国家与地区信息统计")
|
||||
@Data
|
||||
@TableName(value = "country_info")
|
||||
public class CountryInfoVO {
|
||||
/**
|
||||
* 国家id
|
||||
*/
|
||||
@TableId(value = "country_id", type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "国家id")
|
||||
private String countryId;
|
||||
|
||||
/**
|
||||
* 业务区与地区码
|
||||
*/
|
||||
@TableField(value = "country_group")
|
||||
@ApiModelProperty(value = "业务区与地区码")
|
||||
private String countryGroup;
|
||||
|
||||
/**
|
||||
* 业务区与地区名称
|
||||
*/
|
||||
@TableField(value = "country_group_name")
|
||||
@ApiModelProperty(value = "业务区与地区名称")
|
||||
private String countryGroupName;
|
||||
|
||||
/**
|
||||
* 国家名称
|
||||
*/
|
||||
@TableField(value = "country_name")
|
||||
@ApiModelProperty(value = "国家名称")
|
||||
private String countryName;
|
||||
|
||||
/**
|
||||
* 语言
|
||||
*/
|
||||
@TableField(value = "`language`")
|
||||
@ApiModelProperty(value = "语言")
|
||||
private String language;
|
||||
|
||||
/**
|
||||
* 语言中文
|
||||
*/
|
||||
@TableField(value = "language_name")
|
||||
@ApiModelProperty(value = "语言中文")
|
||||
private String languageName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.yupi.springbootinit.service;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/6/13 13:57
|
||||
*/
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yupi.springbootinit.model.entity.CountryInfo;
|
||||
import com.yupi.springbootinit.model.vo.country.CountryInfoVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CountryInfoService extends IService<CountryInfo> {
|
||||
|
||||
List<CountryInfoVO> getCountryList();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yupi.springbootinit.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yupi.springbootinit.model.entity.CountryInfo;
|
||||
import com.yupi.springbootinit.model.vo.country.CountryInfoVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.yupi.springbootinit.mapper.CountryInfoMapper;
|
||||
import com.yupi.springbootinit.service.CountryInfoService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/6/13 13:57
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class CountryInfoServiceImpl extends ServiceImpl<CountryInfoMapper, CountryInfo> implements CountryInfoService{
|
||||
|
||||
@Resource
|
||||
private CountryInfoMapper countryInfoMapper;
|
||||
|
||||
@Override
|
||||
public List<CountryInfoVO> getCountryList() {
|
||||
return countryInfoMapper.selectByCountryGroupName();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user