diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletUserAppController.java b/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletUserAppController.java index e6256af..5137312 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletUserAppController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletUserAppController.java @@ -34,6 +34,17 @@ public class PlayletUserAppController { } } + @ResponseBody + @PostMapping(value = "/onlyLoginByOpenid") + @ApiOperation(value = "单纯通过openid登录系统", httpMethod = "POST") + public Result onlyLoginByOpenid(@RequestParam(value = "openid") String openid){ + try { + return Result.success(playletUserAppService.onlyLoginByOpenid(openid)); + }catch (Exception e){ + return Result.error(e.getMessage()); + } + } + @ResponseBody @PostMapping(value = "/loginByPhone") @ApiOperation(value = "小程序通过手机验证码登录系统", httpMethod = "POST") @@ -56,6 +67,17 @@ public class PlayletUserAppController { } } + @ResponseBody + @PostMapping(value = "/addPlayletUser") + @ApiOperation(value = "新增短剧用户", httpMethod = "POST") + public Result addPlayletUser(@RequestBody PlayletUser playletUser){ + try { + return Result.success(playletUserAppService.addPlayletUser(playletUser)); + }catch (Exception e){ + return Result.error(e.getMessage()); + } + } + @ResponseBody @PostMapping(value = "/updatePlayletUser") @ApiOperation(value = "修改用户资料", httpMethod = "POST") diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletAdviceFeedbackController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletAdviceFeedbackController.java index 9488da1..c0970ab 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletAdviceFeedbackController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletAdviceFeedbackController.java @@ -1,6 +1,9 @@ package com.playlet.web.controller.system; import java.util.List; + +import com.playlet.system.domain.PlayletUser; +import com.playlet.system.service.IPlayletUserService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -34,6 +37,9 @@ public class PlayletAdviceFeedbackController extends BaseController @Autowired private IPlayletAdviceFeedbackService playletAdviceFeedbackService; + @Autowired + private IPlayletUserService iPlayletUserService; + @RequiresPermissions("playlet:feedback:view") @GetMapping() public String feedback() @@ -51,6 +57,13 @@ public class PlayletAdviceFeedbackController extends BaseController { startPage(); List list = playletAdviceFeedbackService.selectPlayletAdviceFeedbackList(playletAdviceFeedback); + list.forEach(model->{ + if(model.getUserId() != null){ + PlayletUser user = iPlayletUserService.getById(model.getUserId()); + model.setUserName(user.getNickName()); + model.setUserPhone(user.getPhone()); + } + }); return getDataTable(list); } diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletItemTypeController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletItemTypeController.java index d6db6ea..a91cc38 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletItemTypeController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletItemTypeController.java @@ -26,7 +26,7 @@ import com.playlet.common.core.page.TableDataInfo; * @date 2024-03-18 */ @Controller -@RequestMapping("/system/playletType") +@RequestMapping("/system/playlet/type") public class PlayletItemTypeController extends BaseController { private String prefix = "system/playlet/type"; diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletMessageController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletMessageController.java index 9a880a2..f6cf806 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletMessageController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletMessageController.java @@ -26,7 +26,7 @@ import com.playlet.common.core.page.TableDataInfo; * @date 2024-03-10 */ @Controller -@RequestMapping("/system/playletMessage") +@RequestMapping("/system/playlet/message") public class PlayletMessageController extends BaseController { private String prefix = "system/playlet/message"; diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserController.java index 084a95f..3613648 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserController.java @@ -122,6 +122,6 @@ public class PlayletUserController extends BaseController @ResponseBody public AjaxResult remove(String ids) { - return toAjax(playletUserService.deletePlayletUserByIDs(ids)); + return toAjax(playletUserService.deletePlayletUserByIds(ids)); } } diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/tool/OssFileController.java b/playlet-admin/src/main/java/com/playlet/web/controller/tool/OssFileController.java index 436df8e..66e3c21 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/tool/OssFileController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/tool/OssFileController.java @@ -8,6 +8,10 @@ import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; /** *

文件上传

@@ -32,4 +36,19 @@ public class OssFileController { } } + @PostMapping(value = "/uploadFromPlaylet") + @ResponseBody + public Result uploadFile(MultipartFile file) { + try { +// String name = request.getParameter("name"); + // 转型为MultipartHttpRequest: +// MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; + // 获得实际: +// MultipartFile file= multipartRequest.getFile(name); + // 上传后返回的文件路径 + return Result.success(ossService.upload(file)); + } catch (Exception e) { + return Result.error(e.getMessage()); + } + } } diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletUserAppService.java b/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletUserAppService.java index 2daabd5..01c6e38 100644 --- a/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletUserAppService.java +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletUserAppService.java @@ -44,4 +44,8 @@ public interface PlayletUserAppService { */ PageInfo getPlayletUserPage(PlayletUser playletUser, Integer pageNum, Integer pageSize); + PlayletUser onlyLoginByOpenid(String openid); + + PlayletUser addPlayletUser(PlayletUser playletUser); + } diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletUserAppServiceImpl.java b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletUserAppServiceImpl.java index 4fdf8e4..3dab46e 100644 --- a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletUserAppServiceImpl.java +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletUserAppServiceImpl.java @@ -28,6 +28,17 @@ public class PlayletUserAppServiceImpl implements PlayletUserAppService { private final StringRedisTemplate stringRedisTemplate; + + @Override + public PlayletUser addPlayletUser(PlayletUser playletUser) { + playletUser.setCreateBy(PlayletConstants.DEFAULT_CREATE); + playletUser.setCreateTime(new Date()); + iPlayletUserService.save(playletUser); + playletUser.setCode("PLAYLET_" + playletUser.getId()); + iPlayletUserService.updateById(playletUser); + return playletUser; + } + @Override public PlayletUser getByOpenId(String openid, String parentId) { PlayletUser playletUser = iPlayletUserService.lambdaQuery().eq(PlayletUser::getOpenId, openid).one(); @@ -46,6 +57,11 @@ public class PlayletUserAppServiceImpl implements PlayletUserAppService { return playletUser; } + @Override + public PlayletUser onlyLoginByOpenid(String openid) { + return iPlayletUserService.lambdaQuery().eq(PlayletUser::getOpenId, openid).one(); + } + @Override public PlayletUser getByPhone(PlayUserReq playUserReq) throws Exception{ String alreadyCode = stringRedisTemplate.opsForValue().get(RedisConstants.SMS_CODE_PREFIX + playUserReq.getPhone()); diff --git a/playlet-admin/src/main/resources/templates/login.html b/playlet-admin/src/main/resources/templates/login.html index a814109..1c70132 100644 --- a/playlet-admin/src/main/resources/templates/login.html +++ b/playlet-admin/src/main/resources/templates/login.html @@ -4,7 +4,7 @@ 追风者 - + @@ -29,7 +29,7 @@
-

欢迎使用 麻雀短剧 后台管理系统

+

欢迎使用 种草达人 后台管理系统

  • SpringBoot
  • Mybatis-plus
  • diff --git a/playlet-admin/src/main/resources/templates/system/playlet/banner/add.html b/playlet-admin/src/main/resources/templates/system/playlet/banner/add.html index 32c2c57..faab1ba 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/banner/add.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/banner/add.html @@ -2,6 +2,7 @@ +
    @@ -13,19 +14,25 @@
    - +
    - + +
    + +
    - +
    - + +
    + +
    - +
    @@ -39,6 +46,7 @@
    + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/banner/banner.html b/playlet-admin/src/main/resources/templates/system/playlet/banner/banner.html index 382ddc5..99b6041 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/banner/banner.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/banner/banner.html @@ -27,9 +27,9 @@ 添加 - - 修改 - + + + 删除 @@ -70,11 +70,19 @@ }, { field: 'url', - title: '广告封面' + title: '广告封面', + formatter: function(value) { + if (value != null && value !== ''){return '封面图片';} + else {return ''} + } }, { field: 'detailUrl', - title: '详情页' + title: '详情页', + formatter: function(value) { + if (value != null && value !== ''){return '详情图片';} + else {return ''} + } }, { field: 'seq', @@ -105,7 +113,7 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); + // actions.push('编辑 '); actions.push('删除'); return actions.join(''); } diff --git a/playlet-admin/src/main/resources/templates/system/playlet/detail/add.html b/playlet-admin/src/main/resources/templates/system/playlet/detail/add.html index 5d5aa9d..5169068 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/detail/add.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/detail/add.html @@ -69,6 +69,7 @@ $(function() { $('.summernote').summernote({ lang: 'zh-CN', + height: 300, dialogsInBody: true, callbacks: { onChange: function(contents, $edittable) { diff --git a/playlet-admin/src/main/resources/templates/system/playlet/feedback/add.html b/playlet-admin/src/main/resources/templates/system/playlet/feedback/add.html index 9cf096b..02e97d9 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/feedback/add.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/feedback/add.html @@ -51,6 +51,7 @@ $(function() { $('.summernote').summernote({ lang: 'zh-CN', + height: 300, dialogsInBody: true, callbacks: { onChange: function(contents, $edittable) { diff --git a/playlet-admin/src/main/resources/templates/system/playlet/feedback/feedback.html b/playlet-admin/src/main/resources/templates/system/playlet/feedback/feedback.html index 089a384..8663819 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/feedback/feedback.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/feedback/feedback.html @@ -67,7 +67,16 @@ }, { field: 'userId', - title: '反馈用户id' + title: '反馈用户id', + visible: false + }, + { + field: 'userName', + title: '反馈人名称' + }, + { + field: 'userPhone', + title: '反馈人电话' }, { field: 'type', diff --git a/playlet-admin/src/main/resources/templates/system/playlet/flow/add.html b/playlet-admin/src/main/resources/templates/system/playlet/flow/add.html index 07dd8b2..c40f019 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/flow/add.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/flow/add.html @@ -39,6 +39,7 @@ $(function() { $('.summernote').summernote({ lang: 'zh-CN', + height: 300, dialogsInBody: true, callbacks: { onChange: function(contents, $edittable) { diff --git a/playlet-admin/src/main/resources/templates/system/playlet/message/add.html b/playlet-admin/src/main/resources/templates/system/playlet/message/add.html index f51e247..62dd4fc 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/message/add.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/message/add.html @@ -2,6 +2,7 @@ +
    @@ -18,10 +19,19 @@
    +
    + +
    + +
    +
    - + +
    @@ -33,6 +43,7 @@
    + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/message/edit.html b/playlet-admin/src/main/resources/templates/system/playlet/message/edit.html index 928c0c3..0e13bc2 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/message/edit.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/message/edit.html @@ -1,6 +1,7 @@ + @@ -19,10 +20,19 @@ +
    + +
    + +
    +
    - + +
    @@ -34,6 +44,7 @@
    + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/message/message.html b/playlet-admin/src/main/resources/templates/system/playlet/message/message.html index 0654c7d..a36e5db 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/message/message.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/message/message.html @@ -50,6 +50,7 @@ \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/service/service.html b/playlet-admin/src/main/resources/templates/system/playlet/service/service.html index 507fac6..def0736 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/service/service.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/service/service.html @@ -27,9 +27,9 @@ 添加 - - 修改 - + + + 删除 @@ -101,7 +101,7 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); + // actions.push('编辑 '); actions.push('删除'); return actions.join(''); } diff --git a/playlet-admin/src/main/resources/templates/system/playlet/user/user.html b/playlet-admin/src/main/resources/templates/system/playlet/user/user.html index 194c5ff..38ea004 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/user/user.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/user/user.html @@ -51,6 +51,7 @@ var editFlag = [[${@permission.hasPermi('system:user:edit')}]]; var removeFlag = [[${@permission.hasPermi('system:user:remove')}]]; var prefix = ctx + "system/playlet/user"; + var statusDict = [[${@dict.getType('playlet_status')}]]; $(function() { var options = { @@ -68,6 +69,10 @@ title: '主键', visible: false }, + { + field: 'code', + title: '编码' + }, { field: 'phone', title: '手机号' @@ -92,6 +97,14 @@ field: 'parentId', title: '父级代理' }, + { + field: 'status', + title: '短剧状态', + align: 'center', + formatter: function(value, row, index) { + return $.table.selectDictLabel(statusDict, value); + } + }, { field: 'createBy', title: '创建人' @@ -117,8 +130,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }] diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PlayletAdviceFeedback.java b/playlet-system/src/main/java/com/playlet/system/domain/PlayletAdviceFeedback.java index 64cee89..2bb4b8a 100644 --- a/playlet-system/src/main/java/com/playlet/system/domain/PlayletAdviceFeedback.java +++ b/playlet-system/src/main/java/com/playlet/system/domain/PlayletAdviceFeedback.java @@ -1,6 +1,7 @@ package com.playlet.system.domain; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.playlet.common.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.TableName; @@ -33,6 +34,12 @@ public class PlayletAdviceFeedback extends BaseEntity @ApiModelProperty(value = "反馈用户id") private Long userId; + @TableField(exist = false) + private String userName; + + @TableField(exist = false) + private String userPhone; + /** 类型 01.功能建议 02.客服投诉 03.其他 */ @Excel(name = "类型 01.功能建议 02.客服投诉 03.其他") @ApiModelProperty(value = "类型 01.功能建议 02.客服投诉 03.其他") diff --git a/playlet-system/src/main/java/com/playlet/system/mapper/PlayletUserMapper.java b/playlet-system/src/main/java/com/playlet/system/mapper/PlayletUserMapper.java index db4d4e2..5f1c2d2 100644 --- a/playlet-system/src/main/java/com/playlet/system/mapper/PlayletUserMapper.java +++ b/playlet-system/src/main/java/com/playlet/system/mapper/PlayletUserMapper.java @@ -15,10 +15,10 @@ public interface PlayletUserMapper extends BaseMapper /** * 查询短剧用户 * - * @param ID 短剧用户主键 + * @param id 短剧用户主键 * @return 短剧用户 */ - public PlayletUser selectPlayletUserByID(Long ID); + public PlayletUser selectPlayletUserById(Long id); /** * 查询短剧用户列表 @@ -47,16 +47,16 @@ public interface PlayletUserMapper extends BaseMapper /** * 删除短剧用户 * - * @param ID 短剧用户主键 + * @param id 短剧用户主键 * @return 结果 */ - public int deletePlayletUserByID(Long ID); + public int deletePlayletUserById(Long id); /** * 批量删除短剧用户 * - * @param IDs 需要删除的数据主键集合 + * @param Ids 需要删除的数据主键集合 * @return 结果 */ - public int deletePlayletUserByIDs(String[] IDs); + public int deletePlayletUserByIds(String[] ids); } diff --git a/playlet-system/src/main/java/com/playlet/system/service/IPlayletUserService.java b/playlet-system/src/main/java/com/playlet/system/service/IPlayletUserService.java index b06468c..f345516 100644 --- a/playlet-system/src/main/java/com/playlet/system/service/IPlayletUserService.java +++ b/playlet-system/src/main/java/com/playlet/system/service/IPlayletUserService.java @@ -15,10 +15,10 @@ public interface IPlayletUserService extends IService /** * 查询短剧用户 * - * @param ID 短剧用户主键 + * @param id 短剧用户主键 * @return 短剧用户 */ - public PlayletUser selectPlayletUserByID(Long ID); + public PlayletUser selectPlayletUserByID(Long id); /** * 查询短剧用户列表 @@ -47,16 +47,16 @@ public interface IPlayletUserService extends IService /** * 批量删除短剧用户 * - * @param IDs 需要删除的短剧用户主键集合 + * @param ids 需要删除的短剧用户主键集合 * @return 结果 */ - public int deletePlayletUserByIDs(String IDs); + public int deletePlayletUserByIds(String ids); /** * 删除短剧用户信息 * - * @param ID 短剧用户主键 + * @param id 短剧用户主键 * @return 结果 */ - public int deletePlayletUserByID(Long ID); + public int deletePlayletUserById(Long id); } diff --git a/playlet-system/src/main/java/com/playlet/system/service/impl/PlayletUserServiceImpl.java b/playlet-system/src/main/java/com/playlet/system/service/impl/PlayletUserServiceImpl.java index f4ea5ec..2e21429 100644 --- a/playlet-system/src/main/java/com/playlet/system/service/impl/PlayletUserServiceImpl.java +++ b/playlet-system/src/main/java/com/playlet/system/service/impl/PlayletUserServiceImpl.java @@ -25,13 +25,13 @@ public class PlayletUserServiceImpl extends ServiceImpl and UPDATE_TIME = #{updateTime} and REMARK = #{remark} + order by seq asc - and PHONE = #{phone} - and NICK_NAME like concat('%', #{nickName}, '%') - and PASSWORD = #{password} - and ICON = #{icon} - and AGENCY_ID = #{agencyId} - and PARENT_ID = #{parentId} - and CREATE_BY = #{createBy} - and CREATE_TIME = #{createTime} - and UPDATE_BY = #{updateBy} - and UPDATE_TIME = #{updateTime} - and REMARK = #{REMARK} + and phone = #{phone} + and nick_name like concat('%', #{nickName}, '%') + and password = #{password} + and icon = #{icon} + and agency_id = #{agencyId} + and parent_id = #{parentId} + and create_by = #{createBy} + and create_time = #{createTime} + and update_by = #{updateBy} + and update_time = #{updateTime} + and remark = #{remark} - - where ID = #{ID} + where id = #{id} insert into playlet_user - PHONE, - NICK_NAME, - PASSWORD, - ICON, - AGENCY_ID, - PARENT_ID, - CREATE_BY, - CREATE_TIME, - UPDATE_BY, - UPDATE_TIME, - REMARK, + phone, + nick_name, + password, + icon, + agency_id, + parent_id, + create_by, + create_time, + update_by, + update_time, + remark, #{phone}, @@ -80,30 +80,30 @@ update playlet_user - PHONE = #{phone}, - NICK_NAME = #{nickName}, - PASSWORD = #{password}, - ICON = #{icon}, - AGENCY_ID = #{agencyId}, - PARENT_ID = #{parentId}, + phone = #{phone}, + nick_name = #{nickName}, + password = #{password}, + icon = #{icon}, + agency_id = #{agencyId}, + parent_id = #{parentId}, status = #{status}, - CREATE_BY = #{createBy}, - CREATE_TIME = #{createTime}, - UPDATE_BY = #{updateBy}, - UPDATE_TIME = #{updateTime}, - REMARK = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, - where ID = #{id} + where id = #{id} - - delete from playlet_user where ID = #{id} + + delete from playlet_user where id = #{id} - - delete from playlet_user where ID in - - #{ID} + + delete from playlet_user where id in + + #{id}