| @@ -9,7 +9,6 @@ import com.iformall.constant.SwaggerConstant; | |||
| import com.iformall.domain.dto.sm.SaveApiMenuDTO; | |||
| import com.iformall.domain.dto.sm.UpdateApiMenuDTO; | |||
| import com.iformall.domain.po.sm.ApiMenu; | |||
| import com.iformall.domain.vo.sm.ApiMenuVO; | |||
| import com.iformall.exception.BizException; | |||
| import com.iformall.service.sm.ApiMenuService; | |||
| import io.swagger.annotations.Api; | |||
| @@ -30,14 +29,14 @@ public class ApiMenuController { | |||
| @ApiVersion(group = SwaggerConstant.V_1_0_0) | |||
| @ApiOperation("分页查询api菜单") | |||
| @GetMapping("/page") | |||
| public R<PageInfo<ApiMenuVO>> pageApiMenu(ApiMenu ApiMenu, Integer pageNum, Integer pageSize) { | |||
| public R<PageInfo<ApiMenu>> pageApiMenu(ApiMenu ApiMenu, Integer pageNum, Integer pageSize) { | |||
| return R.ok(apiMenuService.pageApiMenu(ApiMenu, pageNum, pageSize)); | |||
| } | |||
| @ApiVersion(group = SwaggerConstant.V_1_0_0) | |||
| @ApiOperation("单个查询api菜单") | |||
| @GetMapping("/get") | |||
| public R<ApiMenuVO> getApiMenu(Long id) { | |||
| public R<ApiMenu> getApiMenu(Long id) { | |||
| if (id == null) { | |||
| throw new BizException(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| @@ -69,3 +69,12 @@ ADD COLUMN user_mould_video_id bigint NOT NULL COMMENT '视频记录ID'; | |||
| ALTER TABLE `voice_language` | |||
| ADD COLUMN trial_text varchar(100) COMMENT '试听文本内容'; | |||
| UPDATE voice_language SET trial_text = '遂芒数字人,用人工智能创造无限可能!' WHERE id IN (38,39,43,45,55,77,96,107,123,140) | |||
| UPDATE voice_language SET trial_text = 'Metavatar, AI to create infinite possibilities!' WHERE id IN (144,26,86,118,29) | |||
| UPDATE voice_language SET trial_text = ' ¡¡ el hombre digital suimang crea infinitas posibilidades con inteligencia artificial!' WHERE id IN (61) | |||
| UPDATE voice_language SET trial_text = 'Manusia Digital Suimang, Membuat kemungkinan tak terhingga dengan Intelijen Seni!' WHERE id IN (11) | |||
| UPDATE voice_language SET trial_text = 'Manusia Digital Suimang, Mencipta kemungkinan tak terbatas dengan Intelligence Artificial!' WHERE id IN (5) | |||
| ALTER TABLE `api_menu` | |||
| ADD COLUMN content text COMMENT '内容'; | |||
| @@ -7,7 +7,6 @@ import com.iformall.common.R; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.constant.SwaggerConstant; | |||
| import com.iformall.domain.po.sm.ApiMenu; | |||
| import com.iformall.domain.vo.sm.ApiMenuVO; | |||
| import com.iformall.domain.vo.sm.ListApiSubmenuVO; | |||
| import com.iformall.exception.BizException; | |||
| import com.iformall.service.sm.ApiMenuService; | |||
| @@ -34,22 +33,11 @@ public class ApiMenuController { | |||
| return R.ok(apiMenuService.listMenu()); | |||
| } | |||
| @AuthIgnore | |||
| @ApiVersion(group = SwaggerConstant.V_1_0_0) | |||
| @ApiOperation("查询某个api菜单所有子菜单") | |||
| @GetMapping("/listSubmenu") | |||
| public R<List<ListApiSubmenuVO>> listApiSubmenu(Long id) { | |||
| if (id == null) { | |||
| throw new BizException(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| return R.ok(apiMenuService.listApiSubmenu(id)); | |||
| } | |||
| @AuthIgnore | |||
| @ApiVersion(group = SwaggerConstant.V_1_0_0) | |||
| @ApiOperation("单个查询菜单详情") | |||
| @GetMapping("/get") | |||
| public R<ApiMenuVO> getApiMenu(Long id) { | |||
| public R<ApiMenu> getApiMenu(Long id) { | |||
| if (id == null) { | |||
| throw new BizException(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| @@ -54,6 +54,11 @@ public class ApiMenu extends BaseEntity { | |||
| * 是否删除(0:未删除,1:删除) | |||
| */ | |||
| private Integer deleteFlag; | |||
| /** | |||
| * 是否删除(0:未删除,1:删除) | |||
| */ | |||
| private String content; | |||
| @TableField(exist = false) | |||
| private static final long serialVersionUID = 1L; | |||
| @@ -1,48 +0,0 @@ | |||
| package com.iformall.domain.vo.sm; | |||
| import io.swagger.annotations.ApiModel; | |||
| import io.swagger.annotations.ApiModelProperty; | |||
| import lombok.Data; | |||
| import java.util.Date; | |||
| @ApiModel(value = "查询API菜单响应数据") | |||
| @Data | |||
| public class ApiMenuVO { | |||
| @ApiModelProperty("菜单id") | |||
| private Long id; | |||
| @ApiModelProperty("创建时间") | |||
| private Date createTime; | |||
| @ApiModelProperty("修改时间") | |||
| private Date updateTime; | |||
| @ApiModelProperty("是否叶子节点(0:否,1:是)") | |||
| private Integer leafFlag; | |||
| @ApiModelProperty("菜单名称") | |||
| private String name; | |||
| @ApiModelProperty("父菜单id") | |||
| private Long parentId; | |||
| @ApiModelProperty("状态(0:正常,1:锁定)") | |||
| private Integer status; | |||
| @ApiModelProperty("详情id") | |||
| private Long detailId; | |||
| @ApiModelProperty("是否付费(0:否,1:是)") | |||
| private Integer chargeFlag; | |||
| @ApiModelProperty("是否需用户授权(0:否,1:是)") | |||
| private Integer authFlag; | |||
| @ApiModelProperty("接口描述") | |||
| private String description; | |||
| @ApiModelProperty("平台地址") | |||
| private String platformUrl; | |||
| @ApiModelProperty("系统参数") | |||
| private String publicParam; | |||
| @ApiModelProperty("请求参数") | |||
| private String requestParam; | |||
| @ApiModelProperty("响应参数") | |||
| private String responseParam; | |||
| @ApiModelProperty("请求示例") | |||
| private String requestSample; | |||
| @ApiModelProperty("响应示例") | |||
| private String responseSample; | |||
| @ApiModelProperty("异常示例") | |||
| private String exceptionSample; | |||
| } | |||
| @@ -2,7 +2,6 @@ package com.iformall.mapper; | |||
| import com.iformall.domain.po.sm.ApiMenu; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| import com.iformall.domain.vo.sm.ApiMenuVO; | |||
| import com.iformall.domain.vo.sm.ListApiSubmenuVO; | |||
| import java.util.List; | |||
| @@ -16,9 +15,6 @@ public interface ApiMenuMapper extends BaseMapper<ApiMenu> { | |||
| List<ApiMenu> listParentMenu(); | |||
| List<ApiMenuVO> listApiMenuAndDetail(ApiMenu apiMenu); | |||
| List<ListApiSubmenuVO> listSubmenu(Long id); | |||
| } | |||
| @@ -5,7 +5,6 @@ import com.iformall.domain.dto.sm.SaveApiMenuDTO; | |||
| import com.iformall.domain.dto.sm.UpdateApiMenuDTO; | |||
| import com.iformall.domain.po.sm.ApiMenu; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| import com.iformall.domain.vo.sm.ApiMenuVO; | |||
| import com.iformall.domain.vo.sm.ListApiSubmenuVO; | |||
| import java.util.List; | |||
| @@ -15,7 +14,7 @@ import java.util.List; | |||
| */ | |||
| public interface ApiMenuService extends IService<ApiMenu> { | |||
| PageInfo<ApiMenuVO> pageApiMenu(ApiMenu apiMenu, Integer pageNum, Integer pageSize); | |||
| PageInfo<ApiMenu> pageApiMenu(ApiMenu apiMenu, Integer pageNum, Integer pageSize); | |||
| void saveApiMenu(SaveApiMenuDTO dto); | |||
| @@ -23,9 +22,8 @@ public interface ApiMenuService extends IService<ApiMenu> { | |||
| List<ApiMenu> listParentMenu(); | |||
| ApiMenuVO getApiMenu(Long id); | |||
| ApiMenu getApiMenu(Long id); | |||
| List<ApiMenu> listMenu(); | |||
| List<ListApiSubmenuVO> listApiSubmenu(Long id); | |||
| } | |||
| @@ -9,7 +9,6 @@ import com.iformall.domain.dto.sm.SaveApiMenuDTO; | |||
| import com.iformall.domain.dto.sm.UpdateApiMenuDTO; | |||
| import com.iformall.domain.po.sm.ApiDetail; | |||
| import com.iformall.domain.po.sm.ApiMenu; | |||
| import com.iformall.domain.vo.sm.ApiMenuVO; | |||
| import com.iformall.domain.vo.sm.ListApiSubmenuVO; | |||
| import com.iformall.mapper.ApiDetailMapper; | |||
| import com.iformall.service.sm.ApiMenuService; | |||
| @@ -33,15 +32,15 @@ public class ApiMenuServiceImpl extends ServiceImpl<ApiMenuMapper, ApiMenu> impl | |||
| private ApiDetailMapper apiDetailMapper; | |||
| @Override | |||
| public PageInfo<ApiMenuVO> pageApiMenu(ApiMenu apiMenu, Integer pageNum, Integer pageSize) { | |||
| return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> apiMenuMapper.listApiMenuAndDetail(apiMenu)); | |||
| public PageInfo<ApiMenu> pageApiMenu(ApiMenu apiMenu, Integer pageNum, Integer pageSize) { | |||
| return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> apiMenuMapper.listApiMenu(apiMenu)); | |||
| } | |||
| @Override | |||
| public ApiMenuVO getApiMenu(Long id) { | |||
| public ApiMenu getApiMenu(Long id) { | |||
| ApiMenu apiMenu = new ApiMenu(); | |||
| apiMenu.setId(id); | |||
| List<ApiMenuVO> vos = apiMenuMapper.listApiMenuAndDetail(apiMenu); | |||
| List<ApiMenu> vos = apiMenuMapper.listApiMenu(apiMenu); | |||
| return !CollectionUtils.isEmpty(vos) ? vos.get(0) : null; | |||
| } | |||
| @@ -83,10 +82,6 @@ public class ApiMenuServiceImpl extends ServiceImpl<ApiMenuMapper, ApiMenu> impl | |||
| return apiMenuMapper.listApiMenu(null); | |||
| } | |||
| @Override | |||
| public List<ListApiSubmenuVO> listApiSubmenu(Long id) { | |||
| return apiMenuMapper.listSubmenu(id); | |||
| } | |||
| } | |||
| @@ -13,17 +13,17 @@ | |||
| <result property="status" column="status" jdbcType="TINYINT"/> | |||
| <result property="leafFlag" column="leaf_flag" jdbcType="TINYINT"/> | |||
| <result property="deleteFlag" column="delete_flag" jdbcType="TINYINT"/> | |||
| <result property="content" column="content" jdbcType="TINYINT"/> | |||
| </resultMap> | |||
| <sql id="Base_Column_List"> | |||
| m.id,m.create_time,m.update_time, | |||
| m.name,m.parent_id,m.status, | |||
| m.leaf_flag,m.delete_flag | |||
| m.leaf_flag,m.delete_flag,m.content | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| WHERE 1 = 1 | |||
| AND m.delete_flag = 0 | |||
| WHERE m.delete_flag = 0 | |||
| <if test=" null != id "> | |||
| AND m.`id` = #{id} | |||
| </if> | |||
| @@ -53,39 +53,4 @@ | |||
| m.delete_flag = 0 | |||
| AND m.parent_id = 0 | |||
| </select> | |||
| <select id="listApiMenuAndDetail" resultType="com.iformall.domain.vo.sm.ApiMenuVO"> | |||
| SELECT | |||
| m.id, | |||
| m.create_time AS createTime, | |||
| m.update_time AS updateTime, | |||
| m.leaf_flag AS leafFlag, | |||
| m.`name` AS `name`, | |||
| m.parent_id AS parentId, | |||
| m.`status` AS `status`, | |||
| d.id AS detailId, | |||
| d.charge_flag AS chargeFlag, | |||
| d.auth_flag AS authFlag, | |||
| d.description AS description, | |||
| d.platform_url AS platformUrl, | |||
| d.public_param AS publicParam, | |||
| d.request_param AS requestParam, | |||
| d.response_param AS responseParam, | |||
| d.request_sample AS requestSample, | |||
| d.response_sample AS responseSample, | |||
| d.exception_sample AS exception_sample | |||
| FROM | |||
| api_menu m | |||
| LEFT JOIN api_detail d ON m.id = d.menu_id | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="listSubmenu" resultType="com.iformall.domain.vo.sm.ListApiSubmenuVO"> | |||
| SELECT | |||
| m.id AS id, m.update_time AS updateTime, m.name AS name, m.status AS status, d.id AS detailId, d.description AS description | |||
| FROM | |||
| api_menu m | |||
| LEFT JOIN api_detail d ON m.id = d.menu_id | |||
| WHERE | |||
| m.delete_flag = 0 AND m.`status` = 0 AND m.parent_id = #{id} | |||
| </select> | |||
| </mapper> | |||