class UserController extends BaseController{
    
    @Resource(name = "appEmailUtil")
    private AppEmailUtil appEmailUtil;

    /**
     * 注册用户页面
     */
    @RequestMapping(value = "/register")
    public ModelAndView userRegister(HttpServletRequest request,
            HttpServletResponse response, Model model, Integer success) {
        model.addAttribute("success", success);
        return new ModelAndView("user/userRegister");
    }
    
    /**
     * 注册用户申请
     */
    @RequestMapping(value = "/apply")
    public ModelAndView doAddUser(HttpServletRequest request,
            HttpServletResponse response, Model model, String name, String chName, String email, String mobile, String weChat,
            Integer type, Long userId, Integer isAlert, String password, String company, String purpose) {<FILL_FUNCTION_BODY>}
    
    
    @RequestMapping(value = "/checkUserNameExist")
    public ModelAndView doCheckUserNameExist(HttpServletRequest request,
            HttpServletResponse response, Model model, String userName) {
        AppUser appUser = userService.getByName(userName);
        if (appUser != null) {
            write(response, String.valueOf(SuccessEnum.SUCCESS.value()));
        } else {
            write(response, String.valueOf(SuccessEnum.FAIL.value()));
        }
        return null;
    }
}

        SuccessEnum success = SuccessEnum.SUCCESS;
        try {
            //保存用户(type=-1为无效用户,需要审批)
            AppUser appUser = AppUser.buildFrom(userId, name, chName, email, mobile, weChat, type, isAlert, password, company, purpose);
            userService.save(appUser);
            //提交审批
            AppAudit appAudit = appService.saveRegisterUserApply(appUser,AppAuditType.REGISTER_USER_APPLY);
            appEmailUtil.noticeUserResult(appUser, appAudit);
        } catch (Exception e) {
            success = SuccessEnum.FAIL;
            logger.error(e.getMessage(), e);
        }
        return new ModelAndView("redirect:/user/register?success=" + success.value());
    
<methods>public non-sealed void <init>() ,public boolean clearTempResource(java.lang.String) ,public java.lang.String getTempResource(java.lang.String) ,public com.sohu.cache.entity.AppUser getUserInfo(javax.servlet.http.HttpServletRequest) ,public java.lang.String markdown2html(java.lang.String, java.lang.String) throws java.lang.Exception,public byte[] read(java.io.InputStream) throws java.io.IOException,public java.lang.Boolean saveTempResource(java.lang.String, java.lang.String) ,public void sendMessage(javax.servlet.http.HttpServletResponse, java.lang.String) <variables>protected com.sohu.cache.dao.AppAuditDao appAuditDao,protected com.sohu.cache.dao.AppAuditLogDao appAuditLogDao,protected com.sohu.cache.stats.app.AppDeployCenter appDeployCenter,protected com.sohu.cache.web.util.AppEmailUtil appEmailUtil,protected com.sohu.cache.dao.AppImportDao appImportDao,protected com.sohu.cache.web.service.AppService appService,protected com.sohu.cache.stats.app.AppStatsCenter appStatsCenter,com.sohu.cache.redis.AssistRedisService assistRedisService,protected com.sohu.cache.async.AsyncService asyncService,protected com.sohu.cache.dao.InstanceDao instanceDao,protected com.sohu.cache.stats.instance.InstanceDeployCenter instanceDeployCenter,protected final org.slf4j.Logger logger,protected com.sohu.cache.machine.MachineCenter machineCenter,protected com.sohu.cache.redis.RedisCenter redisCenter,protected com.sohu.cache.redis.RedisConfigTemplateService redisConfigTemplateService,protected com.sohu.cache.redis.RedisDeployCenter redisDeployCenter,protected com.sohu.cache.web.service.ResourceService resourceService,protected com.sohu.cache.web.service.UserLoginStatusService userLoginStatusService,protected com.sohu.cache.web.service.UserService userService