();
27 | // 注解
28 | processors.add(new IftgSelectProcessor());
29 | return processors;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/common/tags/vo/ValueVO.java:
--------------------------------------------------------------------------------
1 | package com.ifast.common.tags.vo;
2 |
3 | import lombok.Data;
4 |
5 | /**
6 | * 控件数值vo
7 | *
8 | * @author: zet
9 | * @date:2018/8/22
10 | */
11 | @Data
12 | public class ValueVO {
13 | /**
14 | * value值
15 | */
16 | private String vlaue;
17 |
18 | /**
19 | * 显示名称
20 | */
21 | private String name;
22 |
23 | /**
24 | * 是否选中
25 | */
26 | private Boolean selected;
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/common/type/EnumCommon.java:
--------------------------------------------------------------------------------
1 | package com.ifast.common.type;
2 |
3 | /**
4 | *
5 | * 通用枚举类
6 | *
7 | * @author Aron
8 | * @version v1.0
9 | * @Date 2019/5/7.
10 | */
11 | public class EnumCommon {
12 |
13 | /**
14 | *
15 | * 用于表示【只有】 是/否 的场景
16 | * 例如:
17 | * deleted 是否删除
18 | * status 是否禁用
19 | * enable 是否启用
20 | * isUse 是否使用中
21 | * isHidden 是否隐藏
22 | *
23 | */
24 | public enum YesOrNo{
25 | YES(1, "是"),
26 | NO(0, "否");
27 |
28 | private int value;
29 | private String desc;
30 |
31 | public int getValue() {
32 | return value;
33 | }
34 | public String getDesc() {
35 | return desc;
36 | }
37 |
38 | YesOrNo(int value, String desc) {
39 | this.value = value;
40 | this.desc = desc;
41 | }
42 | }
43 |
44 |
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/common/utils/CaptchaUtils.java:
--------------------------------------------------------------------------------
1 | package com.ifast.common.utils;
2 |
3 | /**
4 | *
5 | * TODO:验证码相关常量
6 | *
7 | * @author ZYL
8 | * @since:2017年9月12日
9 | * @author ZYL 2017年9月12日
10 | * @version
11 | */
12 | public class CaptchaUtils {
13 |
14 | /**
15 | * TODO:验证码类型
16 | *
17 | * @author EDCwifi-170428
18 | * @since:2017年9月12日
19 | * @author EDCwifi-170428 2017年9月12日
20 | * @version
21 | */
22 | public static enum Type {
23 | /** 注册 */
24 | Register,
25 | /** 绑定手机 */
26 | BinDingPhone,
27 | /** 绑定邮箱 */
28 | BinDingEmail,
29 | /** 忘记密码 */
30 | ForgetPswd,
31 | /** 修改手机号码 */
32 | AlterMobile,
33 | /** 设置支付密码发送验证码 */
34 | Paypwd,
35 | /** 修改邮箱 */
36 | AlterEmail;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/common/utils/CodecUtils.java:
--------------------------------------------------------------------------------
1 | package com.ifast.common.utils;
2 |
3 | import org.apache.commons.codec.binary.Base64;
4 | import org.apache.commons.codec.digest.DigestUtils;
5 |
6 | /**
7 | * 加密工具类
8 | *
9 | * @author Aron
10 | * @date 2017年7月1日
11 | */
12 | public class CodecUtils extends DigestUtils{
13 |
14 | public final static Base64 base64 = new Base64();
15 |
16 | public static String base64Encode(String str){
17 | return base64.encodeToString(str.getBytes());
18 | }
19 |
20 | public static String base64Decode(String str){
21 | return new String(base64.decode(str.getBytes()));
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/common/utils/PasswdUtils.java:
--------------------------------------------------------------------------------
1 | package com.ifast.common.utils;
2 |
3 | import org.apache.shiro.crypto.hash.Sha256Hash;
4 | import org.apache.shiro.crypto.hash.SimpleHash;
5 |
6 | /**
7 | *
8 | *
9 | *
10 | * 2019-05-09 09:42 | Aron
11 | */
12 | public abstract class PasswdUtils {
13 |
14 | public final static String ALGORITHM = Sha256Hash.ALGORITHM_NAME;
15 |
16 | public static String get(String passwd, String salt) {
17 |
18 | return new Sha256Hash(passwd, hash(salt)).toString();
19 | }
20 |
21 | public static SimpleHash hash(String salt) {
22 | return new SimpleHash(ALGORITHM, salt);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/common/utils/ScheduleJobUtils.java:
--------------------------------------------------------------------------------
1 | package com.ifast.common.utils;
2 |
3 | import com.ifast.job.domain.ScheduleJobDO;
4 | import com.ifast.job.domain.TaskDO;
5 |
6 | public class ScheduleJobUtils {
7 | public static ScheduleJobDO entityToData(TaskDO scheduleJobEntity) {
8 | ScheduleJobDO scheduleJob = new ScheduleJobDO();
9 | scheduleJob.setBeanClass(scheduleJobEntity.getBeanClass());
10 | scheduleJob.setCronExpression(scheduleJobEntity.getCronExpression());
11 | scheduleJob.setDescription(scheduleJobEntity.getDescription());
12 | scheduleJob.setIsConcurrent(scheduleJobEntity.getIsConcurrent());
13 | scheduleJob.setJobName(scheduleJobEntity.getJobName());
14 | scheduleJob.setJobGroup(scheduleJobEntity.getJobGroup());
15 | scheduleJob.setJobStatus(scheduleJobEntity.getJobStatus());
16 | scheduleJob.setMethodName(scheduleJobEntity.getMethodName());
17 | scheduleJob.setSpringBean(scheduleJobEntity.getSpringBean());
18 | return scheduleJob;
19 | }
20 | }
--------------------------------------------------------------------------------
/src/main/java/com/ifast/common/utils/ShiroUtils.java:
--------------------------------------------------------------------------------
1 | package com.ifast.common.utils;
2 |
3 | import com.ifast.api.service.AppUserService;
4 | import com.ifast.api.util.JWTUtil;
5 | import com.ifast.sys.domain.UserDO;
6 | import org.apache.shiro.SecurityUtils;
7 | import org.apache.shiro.subject.Subject;
8 |
9 | public class ShiroUtils {
10 |
11 | /**
12 | * 兼容jwt和常规开发时获取用户信息
13 | * @return
14 | */
15 | public static UserDO getSysUser() {
16 | try {
17 | Subject subject = SecurityUtils.getSubject();
18 | Object principal = subject.getPrincipal();
19 | if(principal instanceof String){
20 | String token = (String)principal;
21 | String userId = JWTUtil.getUserId(token);
22 | UserDO userDO = SpringContextHolder.getBean(AppUserService.class).selectById(userId);
23 | return userDO;
24 | }else if(principal instanceof UserDO) {
25 | return (UserDO)principal;
26 | }
27 | }catch (Exception ignore) { }
28 | return null;
29 | }
30 |
31 | public static Long getUserId() {
32 | UserDO sysUser = getSysUser();
33 | return sysUser == null ? null : sysUser.getId();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/common/utils/UUIDUtils.java:
--------------------------------------------------------------------------------
1 | package com.ifast.common.utils;
2 |
3 | import java.util.UUID;
4 |
5 | /**
6 | *
7 | *
8 | *
9 | * 2019-05-09 16:40 | Aron
10 | */
11 | public abstract class UUIDUtils {
12 |
13 | public static String get() {
14 | return get(true);
15 | }
16 |
17 | public static String get(boolean isPureStr) {
18 | String sesult = UUID.randomUUID().toString();
19 | if (isPureStr) {
20 | sesult = sesult.replaceAll("-", "");
21 | }
22 | return sesult;
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/common/validation/ValidForm.java:
--------------------------------------------------------------------------------
1 | package com.ifast.common.validation;
2 |
3 | import java.lang.annotation.*;
4 |
5 | /**
6 | *
7 | * 自动表单验注解
8 | *
9 | * 2018/9/4 12:00 | Aron
10 | */
11 | @Target(ElementType.TYPE)
12 | @Retention(RetentionPolicy.RUNTIME)
13 | @Inherited
14 | public @interface ValidForm {
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/demo/dao/DemoDao.java:
--------------------------------------------------------------------------------
1 | package com.ifast.demo.dao;
2 |
3 | import com.ifast.demo.domain.DemoDO;
4 | import com.ifast.common.base.BaseDao;
5 |
6 | /**
7 | *
8 | *
9 | * 基础表
10 | *
11 | * 2018-07-27 23:38:24 | Aron
12 | */
13 | public interface DemoDao extends BaseDao {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/demo/domain/DemoDO.java:
--------------------------------------------------------------------------------
1 | package com.ifast.demo.domain;
2 |
3 |
4 | import com.baomidou.mybatisplus.annotations.TableId;
5 | import com.baomidou.mybatisplus.annotations.TableName;
6 | import com.ifast.common.base.BaseDO;
7 | import lombok.Data;
8 | import lombok.EqualsAndHashCode;
9 |
10 | import java.math.BigDecimal;
11 | import java.util.Date;
12 |
13 |
14 | /**
15 | *
16 | *
17 | * 基础表
18 | *
19 | * 2018-08-03 11:56:37 | Aron
20 | */
21 | @Data
22 | @SuppressWarnings("serial")
23 | @TableName("app_demo_base")
24 | @EqualsAndHashCode(callSuper=true)
25 | public class DemoDO extends BaseDO {
26 | /** 默认ID_WORKER,mybatis-plus.global-config.id-type:2,应用可以自定义 */
27 | @TableId
28 | private Long id;
29 |
30 | /** 标题 */
31 | private String title;
32 |
33 | /** 发布时间 */
34 | private Date publish;
35 |
36 | /** 正文 */
37 | private String content;
38 |
39 | /** 价格 */
40 | private BigDecimal price;
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/demo/dto/TestValidDTO.java:
--------------------------------------------------------------------------------
1 | package com.ifast.demo.dto;
2 |
3 | import com.ifast.common.validation.ValidForm;
4 | import lombok.Data;
5 | import org.hibernate.validator.constraints.Length;
6 | import org.hibernate.validator.constraints.Range;
7 |
8 | import javax.validation.constraints.NotNull;
9 |
10 | /**
11 | *
12 | *
13 | *
14 | * 2018/9/4 16:49 | Aron
15 | */
16 | @ValidForm
17 | @Data
18 | public class TestValidDTO {
19 |
20 | @NotNull
21 | @Length(max = 20, min = 6)
22 | private String name;
23 |
24 | @NotNull
25 | @Range(min = 1, max = 120)
26 | private Integer age;
27 |
28 | @NotNull
29 | @Range(min = 1, max = 3)
30 | private Integer sex;
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/demo/service/DemoService.java:
--------------------------------------------------------------------------------
1 | package com.ifast.demo.service;
2 |
3 | import com.ifast.demo.domain.DemoDO;
4 | import com.ifast.common.base.CoreService;
5 |
6 | /**
7 | *
8 | *
9 | * 基础表
10 | *
11 | * 2018-07-27 23:38:24 | Aron
12 | */
13 | public interface DemoService extends CoreService {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/demo/service/impl/DemoServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.ifast.demo.service.impl;
2 |
3 | import org.springframework.stereotype.Service;
4 |
5 | import com.ifast.demo.dao.DemoDao;
6 | import com.ifast.demo.domain.DemoDO;
7 | import com.ifast.demo.service.DemoService;
8 | import com.ifast.common.base.CoreServiceImpl;
9 |
10 | /**
11 | *
12 | *
13 | * 基础表
14 | *
15 | * 2018-07-27 23:38:24 | Aron
16 | */
17 | @Service
18 | public class DemoServiceImpl extends CoreServiceImpl implements DemoService {
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/ifast/generator/service/GeneratorService.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | package com.ifast.generator.service;
5 |
6 | import java.util.List;
7 | import java.util.Map;
8 |
9 | import org.springframework.stereotype.Service;
10 |
11 | /**
12 | * @author 1992lcg@163.com
13 | * @Time 2017年9月6日
14 | * @description
15 | *
16 | */
17 | @Service
18 | public interface GeneratorService {
19 | List