优化接口代码
This commit is contained in:
parent
1721c84604
commit
1e831853d6
@ -66,6 +66,8 @@ public class Constant {
|
|||||||
*/
|
*/
|
||||||
public static final String SMS_PREFIX = "code_";
|
public static final String SMS_PREFIX = "code_";
|
||||||
|
|
||||||
|
public static final String DEFAULT_TAG = "新人";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册账户默认分配头像
|
* 注册账户默认分配头像
|
||||||
*/
|
*/
|
||||||
|
@ -31,6 +31,6 @@ public interface SystemService extends IService<SystemEntity> {
|
|||||||
|
|
||||||
PageUtils queryPage(Map<String, Object> params);
|
PageUtils queryPage(Map<String, Object> params);
|
||||||
|
|
||||||
|
SystemEntity miniConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserDao, AppUserEntity> i
|
|||||||
appUser.setCreateTime(DateUtil.nowDateTime());
|
appUser.setCreateTime(DateUtil.nowDateTime());
|
||||||
appUser.setUpdateTime(DateUtil.nowDateTime());
|
appUser.setUpdateTime(DateUtil.nowDateTime());
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
list.add("新人");
|
list.add(Constant.DEFAULT_TAG);
|
||||||
appUser.setTagStr(JSON.toJSONString(list));
|
appUser.setTagStr(JSON.toJSONString(list));
|
||||||
baseMapper.insert(appUser);
|
baseMapper.insert(appUser);
|
||||||
AppUserEntity user = this.lambdaQuery()
|
AppUserEntity user = this.lambdaQuery()
|
||||||
@ -341,7 +341,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserDao, AppUserEntity> i
|
|||||||
appUser.setUpdateTime(DateUtil.nowDateTime());
|
appUser.setUpdateTime(DateUtil.nowDateTime());
|
||||||
appUser.setOpenid(openId);
|
appUser.setOpenid(openId);
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
list.add("新人");
|
list.add(Constant.DEFAULT_TAG);
|
||||||
appUser.setTagStr(JSON.toJSONString(list));
|
appUser.setTagStr(JSON.toJSONString(list));
|
||||||
baseMapper.insert(appUser);
|
baseMapper.insert(appUser);
|
||||||
AppUserEntity users = this.lambdaQuery().eq(AppUserEntity::getOpenid, openId).one();
|
AppUserEntity users = this.lambdaQuery().eq(AppUserEntity::getOpenid, openId).one();
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
package io.linfeng.modules.admin.service.impl;
|
package io.linfeng.modules.admin.service.impl;
|
||||||
|
|
||||||
|
import io.linfeng.common.utils.ConfigConstant;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@ -38,5 +39,12 @@ public class SystemServiceImpl extends ServiceImpl<SystemDao, SystemEntity> impl
|
|||||||
return new PageUtils(page);
|
return new PageUtils(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SystemEntity miniConfig() {
|
||||||
|
return this.lambdaQuery()
|
||||||
|
.eq(SystemEntity::getConfig, ConfigConstant.MINIAPP)
|
||||||
|
.one();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -11,7 +11,6 @@
|
|||||||
*/
|
*/
|
||||||
package io.linfeng.modules.app.controller;
|
package io.linfeng.modules.app.controller;
|
||||||
|
|
||||||
import io.linfeng.common.utils.ConfigConstant;
|
|
||||||
import io.linfeng.common.utils.R;
|
import io.linfeng.common.utils.R;
|
||||||
import io.linfeng.modules.admin.entity.SystemEntity;
|
import io.linfeng.modules.admin.entity.SystemEntity;
|
||||||
import io.linfeng.modules.admin.service.SystemService;
|
import io.linfeng.modules.admin.service.SystemService;
|
||||||
@ -34,12 +33,11 @@ public class AppSystemConfigController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SystemService systemService;
|
private SystemService systemService;
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("logo配置")
|
@ApiOperation("logo配置")
|
||||||
@GetMapping("/miniConfig")
|
@GetMapping("/miniConfig")
|
||||||
public R miniConfig(){
|
public R miniConfig(){
|
||||||
SystemEntity system = systemService.lambdaQuery()
|
SystemEntity system = systemService.miniConfig();
|
||||||
.eq(SystemEntity::getConfig, ConfigConstant.MINIAPP)
|
|
||||||
.one();
|
|
||||||
return R.ok().put("logo",system.getIntro());
|
return R.ok().put("logo",system.getIntro());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user