|
|
|
@@ -10,9 +10,7 @@ import com.iformall.controller.base.BaseController; |
|
|
|
import com.iformall.domain.po.*; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.domain.vo.WxWeappInfo; |
|
|
|
import com.iformall.enums.EnumGroupSupport; |
|
|
|
import com.iformall.enums.EnumInvestUserType; |
|
|
|
import com.iformall.enums.EnumUserAdmin; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.service.*; |
|
|
|
import com.iformall.shiro.PasswordHelper; |
|
|
|
import com.iformall.utils.Constant; |
|
|
|
@@ -330,6 +328,38 @@ public class WxProjectConfigController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("启用/禁用小程序") |
|
|
|
@PostMapping("/appinfoOnOff") |
|
|
|
@SystemControllerLog(description = "启用/禁用小程序信息") |
|
|
|
@TenantIgnore |
|
|
|
public ResultData appinfoOnOff(@RequestBody WxAppinfo wxAppinfo) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::appinfoOnOff"); |
|
|
|
try { |
|
|
|
if(wxAppinfo.getId() == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
WxAppinfo byId = wxAppinfoService.getById(wxAppinfo.getId()); |
|
|
|
if(byId == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"未找到小程序"); |
|
|
|
} |
|
|
|
if(!EnumAppType.B.getCode().equals(byId.getType()) || !EnumAppType.C.getCode().equals(byId.getType())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"小程序类型不支持"); |
|
|
|
} |
|
|
|
if(wxAppinfo.getEnable() == null || !EnumEnableType.Enable.getCode().equals(wxAppinfo.getEnable()) || |
|
|
|
!EnumEnableType.Disable.getCode().equals(wxAppinfo.getEnable())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"参数enable 不合法"); |
|
|
|
} |
|
|
|
WxAppinfo updAppinfo = new WxAppinfo(); |
|
|
|
updAppinfo.setId(wxAppinfo.getId()); |
|
|
|
updAppinfo.setEnable(wxAppinfo.getEnable()); |
|
|
|
wxAppinfoService.saveOrUpdate(updAppinfo); |
|
|
|
return new ResultData(); |
|
|
|
}catch (Exception e){ |
|
|
|
logger.error(e.getMessage(),e); |
|
|
|
return new ResultData(ErrorCode.SYS_SERVER_ERROR); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 这里添加多个用户会生成多套角色 |
|
|
|
*/ |
|
|
|
|