This commit is contained in:
Shaun Chyxion 2017-06-10 00:05:31 +08:00
parent f4890e4b71
commit 06152c7b37
70 changed files with 126 additions and 1622 deletions

View File

@ -29,10 +29,6 @@
<groupId>com.pudonghot.ambition</groupId>
<artifactId>crm-mapper</artifactId>
</dependency>
<dependency>
<groupId>com.pudonghot.ambition</groupId>
<artifactId>file-disk</artifactId>
</dependency>
<dependency>
<groupId>me.chyxion.tigon</groupId>
<artifactId>tigon-service-support</artifactId>
@ -45,6 +41,11 @@
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.4</version>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>org.springframework</groupId>

View File

@ -2,6 +2,8 @@ package com.pudonghot.ambition.crm.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import me.chyxion.tigon.form.FC2;
import me.chyxion.tigon.form.FU2;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Controller;
@ -16,9 +18,6 @@ import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.multipart.support.ByteArrayMultipartFileEditor;
import com.pudonghot.ambition.crm.form.create.BaseFormForCreate;
import com.pudonghot.ambition.crm.form.update.BaseFormForUpdate;
/**
* @version 0.0.1
* @since 0.0.1
@ -50,13 +49,13 @@ public class BaseControllerAdvice {
throws IllegalAccessException, InvocationTargetException {
Object target = binder.getTarget();
String userId = getUserId();
if (target instanceof BaseFormForCreate) {
if (target instanceof FC2) {
log.debug("Base Form [{}] For Create Found, Set Created By [{}].", target, userId);
((BaseFormForCreate) target).setCreatedBy(userId);
((FC2<String>) target).setCreatedBy(userId);
}
else if (target instanceof BaseFormForUpdate) {
else if (target instanceof FU2) {
log.debug("Base Form [{}] For Update Found, Set Updated By [{}].", target, userId);
((BaseFormForUpdate) target).setUpdatedBy(userId);
((FU2<String, String>) target).setUpdatedBy(userId);
}
else if (target != null) {
log.debug("Set Form [{}] Created/Updated By [{}].", target, userId);
@ -72,6 +71,6 @@ public class BaseControllerAdvice {
String getUserId() {
return authService.isAuthenticated() ?
(String) authService.getAuthUser().getUserId() : null;
(String) authService.getAuthUser().getUserId() : null;
}
}

View File

@ -1,6 +1,8 @@
package com.pudonghot.ambition.crm.controller;
import javax.validation.Valid;
import me.chyxion.tigon.form.FC2;
import me.chyxion.tigon.model.BaseModel;
import me.chyxion.tigon.model.ViewModel;
import me.chyxion.tigon.form.BaseFormForUpdateApi;
@ -10,8 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.pudonghot.ambition.crm.form.create.BaseFormForCreate;
/**
* @version 0.0.1
* @since 0.0.1
@ -21,7 +21,7 @@ import com.pudonghot.ambition.crm.form.create.BaseFormForCreate;
*/
public class BaseCruController<
Model extends BaseModel<String>,
FC extends BaseFormForCreate,
FC extends FC2<String>,
FU extends BaseFormForUpdateApi<String>>
extends BaseQueryController<Model> {

View File

@ -1,12 +1,11 @@
package com.pudonghot.ambition.crm.controller;
import me.chyxion.tigon.form.FC2;
import me.chyxion.tigon.model.BaseModel;
import javax.validation.constraints.NotNull;
import me.chyxion.tigon.form.BaseFormForUpdateApi;
import org.springframework.web.bind.annotation.RequestParam;
import com.pudonghot.ambition.crm.form.create.BaseFormForCreate;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
@ -19,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
*/
public class BaseCrudController<
Model extends BaseModel<String>,
FC extends BaseFormForCreate,
FC extends FC2<String>,
FU extends BaseFormForUpdateApi<String>>
extends BaseCruController<Model, FC, FU> {

View File

@ -1,56 +0,0 @@
package com.pudonghot.ambition.crm.controller;
import java.io.File;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.Assert;
import me.chyxion.tigon.mybatis.Search;
import javax.servlet.http.HttpServletRequest;
import me.chyxion.tigon.webmvc.ResourceModel;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import com.pudonghot.ambition.crm.mapper.FileInfoMapper;
import com.pudonghot.ambition.crm.model.FileInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @version 0.0.1
* @since 0.0.1
* @author Auto Generated <br>
* Tech Support <a href="mailto:chyxion@163.com">Shaun Chyxion</a><br>
* Sep 14, 2016 3:53:04 PM
*/
@Slf4j
@Controller
public class FileController {
@Value("${file.base-dir}")
private String fileBaseDir;
@Autowired
private FileInfoMapper fileInfoMapper;
@RequestMapping("/f/**")
public Object file(HttpServletRequest request) {
String reqUri = request.getRequestURI();
Assert.state(reqUri.length() > 3, "File Name Could Not Be Blank");
String fileName = reqUri.substring((request.getContextPath() + "/f/").length());
log.info("Get File [{}].", fileName);
FileInfo fileInfo = fileInfoMapper.find(new Search(FileInfo.NAME,
fileName.replaceAll("\\.\\w+$", "")));
ResourceModel rm = null;
if (fileInfo != null) {
final File file = new File(fileBaseDir,
fileInfo.getName() + "." + fileInfo.getFormat());
if (file.exists()) {
rm = new ResourceModel(file,
fileInfo.getContentType(), null);
rm.setName(fileInfo.getDownloadName());
}
}
return rm != null ? rm : ResponseEntity.notFound().build();
}
}

View File

@ -1,16 +1,13 @@
package com.pudonghot.ambition.crm.controller;
import java.io.InputStream;
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import me.chyxion.tigon.model.ViewModel;
import me.chyxion.tigon.model.ListResult;
import javax.servlet.http.HttpServletRequest;
import com.pudonghot.ambition.crm.model.User;
import org.springframework.stereotype.Controller;
import com.pudonghot.ambition.crm.service.UserService;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMapping;
@ -43,18 +40,14 @@ public class UserController
@RequestMapping(value = "/create", method = RequestMethod.POST)
public ViewModel<User> create(
@Valid UserFormForCreate form,
HttpServletRequest request) {
return ((UserService) queryService)
.create(form, getAvatar(request));
@Valid UserFormForCreate form) {
return ((UserService) queryService).create(form);
}
@RequestMapping(value = "/update", method = RequestMethod.POST)
public ViewModel<User> update(
@Valid UserFormForUpdate form,
HttpServletRequest request) {
return ((UserService) queryService)
.update(form, getAvatar(request));
@Valid UserFormForUpdate form) {
return ((UserService) queryService).update(form);
}
@RequestMapping(value = "/profile")
@ -62,13 +55,6 @@ public class UserController
return queryService.findViewModel(getUserId());
}
@RequestMapping(value = "/upload-avatar")
public ViewModel<User> uploadAvatar(
@RequestParam("avatar") MultipartFile avatar) {
return ((UserService) queryService).update(
getUserId(), getInputStream(avatar));
}
@RequestMapping(value = "/update-password")
public ViewModel<User> uploadPassword(@RequestParam("password") String password) {
return ((UserService) queryService).updatePassword(getUserId(), password);
@ -85,8 +71,4 @@ public class UserController
User.EMAIL,
User.NOTE};
}
private InputStream getAvatar(HttpServletRequest request) {
return getInputStream(request, "avatar");
}
}

View File

@ -1,14 +1,12 @@
package com.pudonghot.ambition.crm.service;
import java.io.InputStream;
import javax.validation.Valid;
import com.pudonghot.ambition.crm.form.create.UserFormForCreate;
import com.pudonghot.ambition.crm.form.update.UserFormForUpdate;
import me.chyxion.tigon.model.ViewModel;
import javax.validation.constraints.NotNull;
import com.pudonghot.ambition.crm.model.User;
import me.chyxion.tigon.service.BaseCrudService;
import org.hibernate.validator.constraints.NotBlank;
import com.pudonghot.ambition.crm.form.create.UserFormForCreate;
import com.pudonghot.ambition.crm.form.update.UserFormForUpdate;
import me.chyxion.tigon.service.BaseCrudByFormService;
/**
* @version 0.0.1
@ -18,8 +16,7 @@ import com.pudonghot.ambition.crm.form.update.UserFormForUpdate;
* May 4, 2016 1:18:42 PM
*/
public interface UserService
extends BaseCrudService<String, User> {
String AVATAR_FOLDER = "user_avatar";
extends BaseCrudByFormService<String, User, UserFormForCreate, UserFormForUpdate> {
/**
* find user by login id
@ -34,41 +31,8 @@ public interface UserService
* @return true if password is correct
*/
boolean validatePassword(
@NotNull String adminId,
@NotBlank String password);
/**
* create admin
* @param form form
* @param avatar avatar
* @return admin view model
*/
ViewModel<User> create(
@NotNull
@Valid
UserFormForCreate form,
InputStream avatar);
/**
* update admin
* @param form form
* @param avatar avatar
* @return admin view model
*/
@NotNull ViewModel<User> update(
@NotNull
@Valid
UserFormForUpdate form,
InputStream avatar);
/**
* @param adminId
* @param avatar
* @return admin view model
*/
@NotNull ViewModel<User> update(
@NotBlank String adminId,
@NotNull InputStream avatar);
@NotNull String adminId,
@NotBlank String password);
/**
* @param userId admin id

View File

@ -7,10 +7,8 @@ import org.springframework.util.Assert;
import me.chyxion.tigon.mybatis.Search;
import me.chyxion.tigon.model.ViewModel;
import com.pudonghot.ambition.crm.model.User;
import com.pudonghot.ambition.file.ImageTool;
import org.springframework.stereotype.Service;
import com.pudonghot.ambition.util.Sha512Utils;
import com.pudonghot.ambition.file.AmbitionFileApi;
import com.pudonghot.ambition.crm.mapper.UserMapper;
import com.pudonghot.ambition.crm.service.UserService;
import org.springframework.beans.factory.annotation.Value;
@ -33,46 +31,6 @@ public class UserServiceSupport
extends BaseCrudByFormServiceSupport<String, User,
UserFormForCreate, UserFormForUpdate, UserMapper>
implements UserService {
@Autowired
private AmbitionFileApi fileApi;
@Autowired
private ImageTool imageTool;
@Value("${user.avatar.size:512}")
private int defaultAvatarSize;
/**
* {@inheritDoc}
*/
@Override
@Transactional
public ViewModel<User> create(UserFormForCreate form, InputStream avatar) {
final ViewModel<User> viewModel = super.create(form);
final User user = viewModel.getData();
if (avatar != null) {
uploadAvatar(user.getId(), avatar);
}
else {
uploadAvatar(user.getId(),
user.getName(),
user.getGender());
}
return viewModel;
}
/**
* {@inheritDoc}
*/
@Override
@Transactional
public ViewModel<User> update(UserFormForUpdate form, InputStream avatar) {
ViewModel<User> viewModel = update(form);
if (avatar != null) {
fileApi.uploadImage(imageTool.cropToSquare(avatar, defaultAvatarSize),
AVATAR_FOLDER, form.getId());
}
return viewModel;
}
/**
* {@inheritDoc}
@ -101,22 +59,6 @@ public class UserServiceSupport
return user != null ? toViewModel(user) : null;
}
/**
* {@inheritDoc}
*/
@Override
@Transactional
public ViewModel<User> update(String userId, InputStream avatar) {
final User user = mapper.find(userId);
Assert.state(user != null, "No Admin [" + userId + "] Found");
user.setUpdatedBy(userId);
user.setDateUpdated(new Date());
mapper.update(user);
fileApi.uploadImage(imageTool.cropToSquare(avatar, defaultAvatarSize),
AVATAR_FOLDER, userId);
return toViewModel(user);
}
/**
* {@inheritDoc}
*/
@ -128,32 +70,6 @@ public class UserServiceSupport
return update(user);
}
/**
* {@inheritDoc}
*/
@Override
protected void processViewModel(ViewModel<User> viewModel, User model) {
super.processViewModel(viewModel, model);
if (model != null) {
viewModel.setAttr("avatar", urlCacheClear(model,
fileApi.getUrl(AVATAR_FOLDER, model.getId())));
}
}
String uploadAvatar(final String userId, final String name, final String gender) {
return fileApi.uploadAvatar(AVATAR_FOLDER, userId, name, gender);
}
String uploadAvatar(String id, InputStream avatar) {
String avatarUrl = null;
if (avatar != null) {
avatarUrl = fileApi.uploadImage(
imageTool.cropToSquare(avatar, defaultAvatarSize),
AVATAR_FOLDER, id);
}
return avatarUrl;
}
protected String hashPassword(final String passwordSalt, final String password) {
return Sha512Utils.encode(password, passwordSalt);
}

View File

@ -1,20 +1,16 @@
# Server
server.port=8088
# MySQL
db.url=jdbc:mysql://127.0.0.1:43306/ambition_crm?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
db.user=root
db.password=696@2^~)oZ@^#*Q
file.server.base-path=http://10.0.10.93:41116/file/
file.base-dir=/Users/chyxion/files
datasource.host=127.0.0.1
datasource.port=43306
datasource.database-name=ambition_crm
datasource.username=root
datasource.password=696@2^~)oZ@^#*Q
# Redis
redis.host=127.0.0.1
redis.port=46379
redis.password=0211
# Session Redis prefix
shiro.session.redis.prefix=ADMIN_AUTH_SESSION
# Shiro
shiro.session.validation.scheduler.enabled=true
spring.http.multipart.max-file-size=1024MB
spring.http.multipart.max-request-size=1024MB

View File

@ -1,21 +1,16 @@
# Server
server.port=8088
# MySQL
db.url=jdbc:mysql://127.0.0.1:43306/ambition_crm?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
db.user=root
db.password=696@2^~)oZ@^#*Q
file.server.base-path=http://127.0.0.:8088/f/
file.base-dir=/Users/chyxion/files
datasource.host=127.0.0.1
datasource.port=43306
datasource.database-name=ambition_crm
datasource.username=root
datasource.password=696@2^~)oZ@^#*Q
# Redis
redis.host=127.0.0.1
redis.port=46379
redis.password=0211
redis.database=2
# Session Redis prefix
# shiro.session.redis.prefix=ADMIN_AUTH_SESSION
# Shiro
shiro.session.validation.scheduler.enabled=true
spring.http.multipart.max-file-size=1024MB
spring.http.multipart.max-request-size=1024MB

View File

@ -1,21 +1,16 @@
# Server
server.port=8100
# MySQL
db.url=jdbc:mysql://127.0.0.1:43306/ambition_crm?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
db.user=root
db.password=696@2^~)oZ@^#*Q
file.server.base-path=http://10.0.10.93:41116/file/
file.base-dir=/Users/chyxion/files
datasource.host=127.0.0.1
datasource.port=43306
datasource.database-name=ambition_crm
datasource.username=root
datasource.password=696@2^~)oZ@^#*Q
# Redis
redis.host=127.0.0.1
redis.port=46379
redis.password=0211
# Session Redis prefix
shiro.session.redis.prefix=ADMIN_AUTH_SESSION
# Shiro
shiro.session.validation.scheduler.enabled=true
spring.http.multipart.max-file-size=1024MB
spring.http.multipart.max-request-size=1024MB

View File

@ -1,22 +0,0 @@
# Config Dev
oss.host.internal=oss-cn-hangzhou.aliyuncs.com
# OSS SIT
#ali.access.key=fkNUAQTZkBFFEn8r
#ali.access.password=bPEEP8mxpGlMs7CL3EvQUGfTAPsm8i
#oss.bucket=echat-uat
# oss.folder=echat_uat/
# oss.folder=echat_dev/
#oss.bucket=echat-sit
#oss.folder=echat_sit/
# OSS Prod
ali.access.key=kiEjn4z5uVejyiPy
ali.access.password=sgNYMjJ7X9rGRP09ps2bPgqkjCEffN
oss.bucket=echat-prod
oss.folder=echat_prod/
db.url=jdbc:mysql://127.0.0.1:3308/echat_prod
db.user=echat_user
db.password=echat_user402

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:property-placeholder location="classpath:spring/config.properties" />
<bean class="org.springframework.jdbc.core.JdbcTemplate">
<constructor-arg>
<bean class="com.alibaba.druid.pool.DruidDataSource"
init-method="init"
destroy-method="close"
p:url="${db.url}"
p:username="${db.user}"
p:password="${db.password}"
p:maxActive="16" />
</constructor-arg>
</bean>
</beans>

View File

@ -33,14 +33,6 @@
<groupId>me.chyxion.tigon</groupId>
<artifactId>tigon-mybatis</artifactId>
</dependency>
<dependency>
<groupId>me.chyxion.tigon</groupId>
<artifactId>tigon-mybatis-redis-cache</artifactId>
</dependency>
<dependency>
<groupId>me.chyxion.tigon</groupId>
<artifactId>tigon-redis</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>

View File

@ -1,10 +1,8 @@
# Config Dev
# Database
db.url=jdbc:mysql://127.0.0.1:43306/ambition_crm?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
db.user=root
db.password=696@2^~)oZ@^#*Q
redis.host=127.0.0.1
redis.port=46379
redis.password=0211
datasource.host=127.0.0.1
datasource.port=43306
datasource.database-name=ambition_crm
datasource.username=root
datasource.password=696@2^~)oZ@^#*Q

View File

@ -14,10 +14,11 @@
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
init-method="init"
destroy-method="close"
p:url="${db.url}"
p:username="${db.user}"
p:password="${db.password}"
p:maxActive="16" />
p:url="jdbc:mysql://${datasource.host}:${datasource.port}/${datasource.database-name}?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull"
p:username="${datasource.username}"
p:password="${datasource.password}"
/>
<!-- Transaction -->
<bean name="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
@ -25,10 +26,8 @@
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<!-- MyBatis SqlSessionFactory -->
<bean id="redisCacheConfig" class="me.chyxion.tigon.mybatis.cache.RedisCacheConfig" />
<bean id="sqlSessionFactory"
<bean id="sqlSessionFactory"
class="me.chyxion.tigon.mybatis.TigonSqlSessionFactoryBean"
depends-on="redisCacheConfig"
p:dataSource-ref="dataSource"
p:typeAliasesPackage="com.pudonghot.ambition.crm.model"
p:configLocation="classpath:mybatis/mybatis-config.xml"
@ -41,5 +40,5 @@
<bean class="org.springframework.jdbc.core.JdbcTemplate">
<constructor-arg ref="dataSource" />
</bean>
<bean class="me.chyxion.tigon.mybatis.cache.support.CacheToolSupport" />
</beans>

View File

@ -1,23 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 10, 2016 1:42:01 PM
*/
@Getter
@Setter
public class AbstractAccountFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
@NotBlank
@Length(max = 36)
protected String password;
}

View File

@ -1,31 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.URL;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 10, 2016 1:42:01 PM
*/
@Getter
@Setter
public class ApiFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotNull
private Long apiGroupId;
@NotBlank
@Length(max = 36)
private String name;
@URL
@NotBlank
private String api;
}

View File

@ -1,27 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 10, 2016 1:42:01 PM
*/
@Getter
@Setter
public class ApiGroupFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
@Length(max = 36)
private String name;
@NotBlank
@Length(max = 36)
private String loginType;
}

View File

@ -1,40 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.NotBlank;
import com.pudonghot.ambition.crm.common.Constants;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 16, 2016 10:04:11 AM
*/
@Getter
@Setter
public class AppAuthFailedLogFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
private String mobile;
@NotBlank
private String password;
@NotBlank
@Pattern(regexp = Constants.PLATFORM_REGEXP)
private String platform;
@NotBlank
private String deviceId;
@NotBlank
private String deviceName;
@NotBlank
private String osVersion;
@NotBlank
private String ip;
private String ext;
}

View File

@ -1,49 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import com.pudonghot.ambition.crm.model.Rgba;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Jun 5, 2016 7:33:25 PM
*/
@Getter
@Setter
public class AppConfigFooterItemFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotNull
private Long appConfigId;
@NotBlank
@Length(max = 36)
private String name;
@NotNull
private Rgba textColorActive;
@NotNull
private Rgba textColorNormal;
@NotBlank
@Length(max = 16)
private String text;
// @URL
@NotBlank
private String action;
@Min(0)
private int sort;
@NotEmpty
private byte[] iconNormal;
@NotEmpty
private byte[] iconActive;
@NotNull
private boolean active;
}

View File

@ -1,39 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import com.pudonghot.ambition.crm.model.Rgba;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Aug 1, 2016 9:40:28 AM
*/
@Getter
@Setter
public class AppConfigFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
@NotBlank
@Length(max = 36)
private String name;
@NotNull
private Rgba themeColor;
@NotNull
private Rgba headerBgColor;
@NotNull
private Rgba headerTextColor;
@NotNull
private Rgba footerTopBorderColor;
@NotNull
private Rgba footerBgColor;
private byte[] headerBgImg;
private byte[] footerBgImg;
}

View File

@ -1,32 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import me.chyxion.tigon.form.BaseFormForCreateApi;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Sep 16, 2015 3:01:35 PM
*/
@Getter
@Setter
public class AppFormForCreate
extends BaseFormForCreate
implements BaseFormForCreateApi {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
@Length(max = 36)
private String name;
private Long apiGroupId;
private Long appConfigId;
private Long splashId;
private Long themeId;
}

View File

@ -1,40 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import me.chyxion.tigon.form.FC1;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.NotBlank;
import com.pudonghot.ambition.crm.common.Constants;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 10, 2016 1:42:01 PM
*/
@Getter
@Setter
public class AppLoginLogFormForCreate extends FC1 {
private static final long serialVersionUID = 1L;
// Properties
@NotNull
private Long userId;
@NotBlank
@Pattern(regexp = Constants.PLATFORM_REGEXP)
private String platform;
@NotBlank
private String deviceId;
@NotBlank
private String deviceName;
@NotBlank
private String osVersion;
@NotBlank
private String ip;
private String ext;
}

View File

@ -1,31 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 10, 2016 1:42:01 PM
*/
@Getter
@Setter
public class AppLogoutFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotNull
private Long userId;
@NotBlank
private String type;
@NotBlank
private String userAgent;
@NotBlank
private String ip;
private String ext;
}

View File

@ -1,36 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Sep 16, 2015 3:01:35 PM
*/
@Getter
@Setter
public class AppVersionAppointFormForCreate
extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotNull
private Long appId;
@NotBlank
private String platform;
@NotBlank
@Length(max = 36)
private String name;
@NotBlank
// @Pattern(regexp = MOBILE_REGEXP)
private String mobile;
@NotNull
private Long versionId;
}

View File

@ -1,32 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Sep 16, 2015 3:01:35 PM
*/
@Getter
@Setter
public class AppVersionFormForCreate
extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
@NotNull
private Long appId;
@Length(max = 36)
private String appName;
@NotBlank
private String platform;
private String releaseNote;
private String downloadName;
private boolean override;
}

View File

@ -1,33 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Sep 16, 2015 3:01:35 PM
*/
@Getter
@Setter
public class AppVersionGroupFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
@Length(max = 36)
private String name;
@NotNull
private Long appId;
@NotNull
private Long androidPhoneVersionId;
@NotNull
private Long iphoneVersionId;
private Long androidPadVersionId;
private Long ipadVersionId;
}

View File

@ -1,18 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import me.chyxion.tigon.form.FC2;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Dec 10, 2015 10:14:47 AM
*/
@Getter
@Setter
public class BaseFormForCreate extends FC2<String> {
private static final long serialVersionUID = 1L;
}

View File

@ -1,41 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import com.pudonghot.ambition.crm.common.Constants;
/**
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 29, 2017 23:07:32
*/
@Getter
@Setter
public class ContactFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotNull
private Long corpId;
@NotNull
private Long deptId;
private int sort;
@NotBlank
@Length(max = 36)
private String name;
@NotBlank
private String mobile;
@NotBlank
@Pattern(regexp = Constants.GENDER_REGEXP)
private String gender;
@Email
private String email;
private String wechat;
}

View File

@ -1,31 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Mar 10, 2017 16:19:57
*/
@Getter
@Setter
public class CorpFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
@Length(max = 64)
private String name;
@NotBlank
@Length(max = 36)
private String shortName;
private Long defaultTinyAppGroupId;
private boolean useTinyAppGroup;
private Long apiGroupId;
private Long appConfigId;
private Long themeId;
private Long splashId;
}

View File

@ -1,27 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Mar 10, 2017 16:19:57
*/
@Getter
@Setter
public class DeptFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotNull
private Long corpId;
private Long ancestor;
@NotBlank
@Length(max = 36)
private String name;
private int sort;
}

View File

@ -1,38 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import static com.pudonghot.ambition.crm.common.Constants.GENDER_REGEXP;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import me.chyxion.tigon.form.BaseFormForCreateApi;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Sep 16, 2015 3:01:35 PM
*/
@Getter
@Setter
public class EmployeeFormForCreate
extends BaseFormForCreate
implements BaseFormForCreateApi {
private static final long serialVersionUID = 1L;
// Properties
@NotNull
private Long corpId;
@NotBlank
private String mobile;
@NotBlank
private String name;
@NotBlank
@Pattern(regexp = GENDER_REGEXP)
private String gender;
}

View File

@ -1,25 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.Min;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Mar 10, 2017 16:19:57
*/
@Getter
@Setter
public class SplashFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
@Length(max = 36)
private String name;
@Min(0)
private long duration;
}

View File

@ -1,12 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 10, 2016 1:42:01 PM
*/
public class ThemeFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
}

View File

@ -1,32 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.URL;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Mar 10, 2017 16:19:57
*/
@Getter
@Setter
public class TinyAppFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotNull
private Long corpId;
private Long groupId;
private int sort;
@NotBlank
@Length(max = 36)
private String name;
@URL
@NotBlank
@Length(max = 2048)
private String url;
}

View File

@ -1,26 +0,0 @@
package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Mar 10, 2017 16:19:57
*/
@Getter
@Setter
public class TinyAppGroupFormForCreate extends BaseFormForCreate {
private static final long serialVersionUID = 1L;
// Properties
@NotNull
private Long corpId;
private int sort;
@NotBlank
@Length(max = 36)
private String name;
}

View File

@ -2,6 +2,8 @@ package com.pudonghot.ambition.crm.form.create;
import lombok.Getter;
import lombok.Setter;
import me.chyxion.tigon.form.FC2;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
@ -17,7 +19,7 @@ import static com.pudonghot.ambition.crm.common.Constants.GENDER_REGEXP;
*/
@Getter
@Setter
public class UserFormForCreate extends AbstractAccountFormForCreate {
public class UserFormForCreate extends FC2<String> {
private static final long serialVersionUID = 1L;
@NotBlank
@ -25,16 +27,23 @@ public class UserFormForCreate extends AbstractAccountFormForCreate {
private String loginId;
@NotBlank
@Length(max = 36)
private String employeeId;
@NotBlank
@Length(max = 36)
protected String password;
@NotBlank
@Length(max = 36)
private String name;
@NotBlank
@Pattern(regexp = GENDER_REGEXP)
private String gender;
@NotBlank
// @Pattern(regexp = MOBILE_REGEXP)
@Length(max = 16)
private String mobile;
@Email
@NotBlank
@Length(max = 64)
private String email;
@NotNull
private Boolean admin;
}

View File

@ -1,24 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import me.chyxion.tigon.format.annotation.EmptyToNull;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 10, 2016 1:42:01 PM
*/
@Getter
@Setter
public class AbstractAccountFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
@EmptyToNull
@Length(max = 36)
protected String password;
protected String passwordSalt;
}

View File

@ -1,27 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.URL;
import org.hibernate.validator.constraints.Length;
import me.chyxion.tigon.format.annotation.EmptyToNull;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 10, 2016 1:42:01 PM
*/
@Getter
@Setter
public class ApiFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
// Properties
@Length(max = 36)
private String name;
@URL
@EmptyToNull
private String api;
}

View File

@ -1,26 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 10, 2016 1:42:01 PM
*/
@Getter
@Setter
public class ApiGroupFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
@NotBlank
@Length(max = 36)
private String name;
@NotBlank
@Length(max = 36)
private String loginType;
}

View File

@ -1,52 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import com.pudonghot.ambition.crm.model.Rgba;
import me.chyxion.tigon.format.annotation.EmptyToNull;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Jun 5, 2016 7:36:14 PM
*/
@Getter
@Setter
public class AppConfigFooterItemFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
@NotBlank
@Length(max = 36)
private String name;
@NotNull
private Rgba textColorActive;
@NotNull
private Rgba textColorNormal;
@NotBlank
@Length(max = 16)
private String text;
@NotBlank
private String action;
@Min(0)
private int sort;
@EmptyToNull
private byte[] iconNormal;
private boolean applyColorToIconNormalSvg;
@EmptyToNull
private byte[] iconActive;
private boolean applyColorToIconActiveSvg;
@NotNull
private Boolean active;
@NotNull
private Boolean noHeader;
@NotNull
private Boolean noFooter;
}

View File

@ -1,41 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import com.pudonghot.ambition.crm.model.Rgba;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Aug 1, 2016 9:47:16 AM
*/
@Getter
@Setter
public class AppConfigFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
@NotBlank
@Length(max = 36)
private String name;
@NotNull
private Rgba themeColor;
@NotNull
private Rgba headerBgColor;
@NotNull
private Rgba headerTextColor;
@NotNull
private Rgba footerTopBorderColor;
@NotNull
private Rgba footerBgColor;
private byte[] headerBgImg;
private boolean deleteHeaderBgImg;
private byte[] footerBgImg;
private boolean deleteFooterBgImg;
}

View File

@ -1,28 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Sep 16, 2015 3:02:14 PM
*/
@Setter
@Getter
public class AppFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
@Length(max = 36)
private String name;
private Long apiGroupId;
private Long appConfigId;
private Long splashId;
private Long themeId;
}

View File

@ -1,27 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Sep 16, 2015 3:02:14 PM
*/
@Getter
@Setter
public class AppReleaseFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
@NotNull
private Long appId;
@NotBlank
private String platform;
@NotNull
private Long versionId;
private Long minVersionId;
}

View File

@ -1,35 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Sep 16, 2015 3:01:35 PM
*/
@Getter
@Setter
public class AppVersionAppointFormForUpdate
extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
@Length(max = 36)
private Long appId;
@NotBlank
private String platform;
@NotBlank
@Length(max = 36)
private String name;
@NotBlank
// @Pattern(regexp = MOBILE_REGEXP)
private String mobile;
@NotNull
private Long versionId;
}

View File

@ -1,39 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import me.chyxion.tigon.format.annotation.EmptyToNull;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br />
* chyxion@163.com <br />
* Sep 16, 2015 3:01:35 PM
*/
@Getter
@Setter
public class AppVersionFormForUpdate
extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
@NotNull
private Long appId;
@Length(max = 36)
private String appName;
@NotBlank
private String platform;
private Long apiGroupId;
private Long appConfigId;
private Long splashId;
private Long themeId;
private Long updateToVersionId;
@NotNull
private Boolean disableUpdate;
@EmptyToNull
private String releaseNote;
@EmptyToNull
private String metaData;
}

View File

@ -1,29 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Sep 16, 2015 3:02:14 PM
*/
@Getter
@Setter
public class AppVersionGroupFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
@Length(max = 36)
private String name;
private Long androidPhoneVersionId;
private Long iphoneVersionId;
private Long androidPadVersionId;
private Long ipadVersionId;
private boolean deleteIcon;
}

View File

@ -1,31 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import me.chyxion.tigon.form.BaseForm;
import javax.validation.constraints.NotNull;
import me.chyxion.tigon.form.BaseFormForUpdateApi;
import me.chyxion.tigon.format.annotation.EmptyToNull;
import me.chyxion.tigon.validation.annotation.NotNullOrBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Dec 10, 2015 10:15:41 AM
*/
@Getter
@Setter
public class BaseFormForUpdate extends BaseForm implements BaseFormForUpdateApi<String> {
private static final long serialVersionUID = 1L;
@NotNullOrBlank
protected String id;
@NotNull
protected String updatedBy;
@EmptyToNull
protected String note;
@NotNull
protected Boolean enabled;
}

View File

@ -1,39 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import com.pudonghot.ambition.crm.common.Constants;
/**
* @author Donghuang <br>
* donghuang@wacai.com <br>
* May 29, 2017 23:07:22
*/
@Getter
@Setter
public class ContactFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
// Properties
@NotNull
private Long deptId;
private int sort;
@NotBlank
@Length(max = 36)
private String name;
@NotBlank
private String mobile;
@NotBlank
@Pattern(regexp = Constants.GENDER_REGEXP)
private String gender;
@Email
private String email;
private String wechat;
}

View File

@ -1,33 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Aug 1, 2016 9:51:27 AM
*/
@Getter
@Setter
public class CorpFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
@Length(max = 64)
private String name;
@NotBlank
@Length(max = 36)
private String shortName;
private Long defaultTinyAppGroupId;
private boolean useTinyAppGroup;
private Long apiGroupId;
private Long appConfigId;
private Long themeId;
private Long splashId;
}

View File

@ -1,24 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 29, 2017 23:06:43
*/
@Getter
@Setter
public class DeptFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
// Properties
private Long ancestor;
@NotBlank
@Length(max = 36)
private String name;
private int sort;
}

View File

@ -1,31 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.NotBlank;
import com.pudonghot.ambition.crm.common.Constants;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Sep 16, 2015 3:02:14 PM
*/
@Setter
@Getter
public class EmployeeFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
private String name;
@NotBlank
private String mobile;
@NotBlank
@Pattern(regexp = Constants.GENDER_REGEXP)
private String gender;
}

View File

@ -1,27 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.Min;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Aug 1, 2016 9:51:27 AM
*/
@Getter
@Setter
public class SplashFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
@Length(max = 36)
private String name;
@Min(0)
private long duration;
}

View File

@ -1,12 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* May 10, 2016 1:42:01 PM
*/
public class ThemeFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
}

View File

@ -1,31 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.URL;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Aug 1, 2016 9:51:27 AM
*/
@Getter
@Setter
public class TinyAppFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
@Length(max = 36)
private String name;
private Long groupId;
private int sort;
@URL
@NotBlank
@Length(max = 2048)
private String url;
}

View File

@ -1,25 +0,0 @@
package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
/**
* @version 0.0.1
* @since 0.0.1
* @author Shaun Chyxion <br>
* chyxion@163.com <br>
* Aug 1, 2016 9:51:27 AM
*/
@Getter
@Setter
public class TinyAppGroupFormForUpdate extends BaseFormForUpdate {
private static final long serialVersionUID = 1L;
// Properties
@NotBlank
@Length(max = 36)
private String name;
private int sort;
}

View File

@ -2,10 +2,13 @@ package com.pudonghot.ambition.crm.form.update;
import lombok.Getter;
import lombok.Setter;
import me.chyxion.tigon.form.FU2;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import me.chyxion.tigon.format.annotation.EmptyToNull;
import static com.pudonghot.ambition.crm.common.Constants.GENDER_REGEXP;
/**
@ -17,20 +20,29 @@ import static com.pudonghot.ambition.crm.common.Constants.GENDER_REGEXP;
*/
@Getter
@Setter
public class UserFormForUpdate extends AbstractAccountFormForUpdate {
public class UserFormForUpdate extends FU2<String, String> {
private static final long serialVersionUID = 1L;
@NotBlank
@Length(max = 36)
private String name;
@NotBlank
@Length(max = 36)
private String employeeId;
@NotBlank
@Pattern(regexp = GENDER_REGEXP)
private String gender;
@EmptyToNull
@Length(max = 36)
protected String password;
@NotBlank
// @Pattern(regexp = MOBILE_REGEXP)
@Length(max = 16)
private String mobile;
@Email
@NotBlank
@Length(max = 128)
private String email;
@NotNull
private Boolean admin;
}

View File

@ -1,9 +1,10 @@
package com.pudonghot.ambition.crm.model;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.Setter;
import me.chyxion.tigon.mybatis.Table;
import me.chyxion.tigon.model.M3;
import me.chyxion.tigon.mybatis.Table;
/**
* @version 0.0.1
@ -19,18 +20,22 @@ public class User extends M3<String, String> {
// Column Names
public static final String LOGIN_ID = "login_id";
public static final String EMPLOYEE_ID = "employee_id";
public static final String PASSWORD = "password";
public static final String MOBILE = "mobile";
public static final String EMAIL = "email";
public static final String NAME = "name";
public static final String GENDER = "gender";
public static final String ADMIN = "admin";
// Properties
private String loginId;
private String employeeId;
@JSONField(serialize = false)
private String password;
private String mobile;
private String email;
private String name;
private String gender;
private boolean admin;
}

View File

@ -1,6 +1,8 @@
# Config Dev
# Database
db.url=jdbc:mysql://127.0.0.1:43306/ambition_crm?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
db.user=root
db.password=696@2^~)oZ@^#*Q
datasource.host=127.0.0.1
datasource.port=43306
datasource.database-name=ambition_crm
datasource.username=root
datasource.password=696@2^~)oZ@^#*Q

View File

@ -4,10 +4,13 @@
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="com.alibaba.druid.pool.DruidDataSource"
init-method="init"
destroy-method="close"
p:url="${db.url}"
p:username="${db.user}"
p:password="${db.password}" />
init-method="init"
destroy-method="close"
p:url="jdbc:mysql://${datasource.host}:${datasource.port}/${datasource.database-name}?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull"
p:username="${datasource.username}"
p:password="${datasource.password}"
/>
</beans>

View File

@ -0,0 +1,9 @@
package com.pudonghot.ambition.crm.model;
/**
* @author Donghuang <br>
* donghuang@wacai.com <br>
* Jun 09, 2017 11:22 PM
*/
public class TestDriver {
}

View File

@ -1,11 +1,8 @@
# Config Dev
# Database
db.url=jdbc:mysql://127.0.0.1:3307/echat_sit
db.user=flaginfo_echat
db.password=echat407
# Redis
redis.host=127.0.0.1
redis.port=6379
redis.password=0211
datasource.host=127.0.0.1
datasource.port=43306
datasource.database-name=ambition_crm
datasource.username=root
datasource.password=696@2^~)oZ@^#*Q

View File

@ -24,8 +24,8 @@
<log4j.version>2.8.1</log4j.version>
<mongodb.version>3.2.0</mongodb.version>
<tigon.version>0.0.1-SNAPSHOT</tigon.version>
<spring.version>4.3.6.RELEASE</spring.version>
<spring-boot.version>1.5.2.RELEASE</spring-boot.version>
<spring.version>4.3.8.RELEASE</spring.version>
<spring-boot.version>1.5.3.RELEASE</spring-boot.version>
<shiro.version>1.3.2</shiro.version>
<aspectj.version>1.8.10</aspectj.version>
</properties>

View File

@ -1,6 +0,0 @@
# CodeGen Config
base.cols=enabled,note,date_created,date_updated,created_by,updated_by
base.package=com.pudonghot.ambition
super.base.model.name=M2<Integer>
super.base.model.full.name=me.chyxion.tigon.model.M2
table.prefix=ph

View File

@ -1,6 +0,0 @@
# Config Dev
# Database
db.url=jdbc:mysql://127.0.0.1:43306/pudong_hot
db.user=root
db.password=696@2^~)oZ@^#*Q

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="com.alibaba.druid.pool.DruidDataSource"
init-method="init"
destroy-method="close"
p:url="${db.url}"
p:username="${db.user}"
p:password="${db.password}" />
</beans>

View File

@ -17,7 +17,7 @@
<a href="#" class="navbar-brand">
<small>
<i class="fa fa-leaf"></i>
Ace Admin
Lemo CRM
</small>
</a>
@ -290,7 +290,7 @@
<!-- #section:basics/navbar.user_menu -->
<li class="light-blue">
<a data-toggle="dropdown" href="#" class="dropdown-toggle">
<img class="nav-user-photo" src="{{user.avatar}}" alt="Jason's Photo" />
{{!--<img class="nav-user-photo" src="{{user.avatar}}" alt="Jason's Photo" />--}}
<span class="user-info">
<small>Welcome,</small>
{{user.name}}