| @@ -0,0 +1,56 @@ | |||
| package com.iformall.controller.basic; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.lang.reflect.Method; | |||
| import java.util.*; | |||
| @RestController | |||
| @RequestMapping("enum") | |||
| @Api(description="枚举接口") | |||
| public class EnumController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @SystemControllerLog(description = "会员管理-标签获取") | |||
| @ApiOperation(value="获取枚举对象", notes="根据获取枚举类名获取枚举对象") | |||
| @GetMapping("/getEnum/{type}") | |||
| public ResultData getEnum(@PathVariable("type") String type) { | |||
| if(StringUtils.isBlank(type)){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| String className = "com.iformall.enums." + type; | |||
| List<Map<String, String>> list = new ArrayList<Map<String, String>>(); | |||
| try { | |||
| // 1.得到枚举类对象 | |||
| Class<Enum> clz = (Class<Enum>) Class.forName(className); | |||
| // 2.得到所有枚举常量 | |||
| Object[] objects = clz.getEnumConstants(); | |||
| Method getCode = clz.getMethod("getCode"); | |||
| Method getMessage = clz.getMethod("getMessage"); | |||
| Map<String, String> map = null; | |||
| for (Object obj : objects) { | |||
| map = new HashMap<String, String>(); | |||
| map.put("code", getCode.invoke(obj).toString()); | |||
| map.put("message", getMessage.invoke(obj).toString()); | |||
| list.add(map); | |||
| } | |||
| } catch (Exception e) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"数据不存在"); | |||
| } | |||
| if(list.size() == 0){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"数据不存在"); | |||
| } | |||
| return new ResultData(list); | |||
| } | |||
| } | |||
| @@ -17,14 +17,14 @@ | |||
| <result column="pay_id" jdbcType="BIGINT" property="payId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="pay_bill_id" jdbcType="BIGINT" property="payBillId"/> | |||
| <result column="group_support" jdbcType="INTEGER" property="groupSupport"/> | |||
| <!-- <result column="group_support" jdbcType="INTEGER" property="groupSupport"/>--> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`app_id`,`parent_app_id`,`name`, | |||
| `secret`,`token`,`aes_key`,`msg_data_format`,`access_token`,`last_token_time`,`expires_in`, | |||
| `pay_id`,`type`,`pay_bill_id`,`group_support` | |||
| `pay_id`,`type`,`pay_bill_id` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -86,9 +86,6 @@ | |||
| <if test=" null != payBillId "> | |||
| and `pay_bill_id` = #{payBillId} | |||
| </if> | |||
| <if test=" null != groupSupport "> | |||
| and `group_support` = #{groupSupport} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -29,7 +29,7 @@ | |||
| <result column="refresh_token" jdbcType="VARCHAR" property="refreshToken"/> | |||
| <result column="access_token" jdbcType="VARCHAR" property="accessToken"/> | |||
| <result column="access_token_expire" jdbcType="TIMESTAMP" property="accessTokenExpire"/> | |||
| <result column="group_support" jdbcType="INTEGER" property="groupSupport"/> | |||
| <!-- <result column="group_support" jdbcType="INTEGER" property="groupSupport"/>--> | |||
| <result column="enable" jdbcType="INTEGER" property="enable"/> | |||
| </resultMap> | |||
| @@ -38,7 +38,7 @@ | |||
| `base_status`, `base_time`, `domain_status`, `domain_time`, `webdomain_status`, `webdomain_time`, `template_status`, `template_time`, | |||
| `current_version`,`current_desc`,`release_time`, | |||
| `open_appid`,`bind_open_time`,`refresh_token`, | |||
| `access_token`,`access_token_expire`,`group_support`,`enable` | |||
| `access_token`,`access_token_expire`,`enable` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -115,9 +115,7 @@ | |||
| <if test=" null != bindOpenTime "> | |||
| and `bind_open_time` = #{bindOpenTime} | |||
| </if> | |||
| <if test=" null != groupSupport "> | |||
| and `group_support` = #{groupSupport} | |||
| </if> | |||
| <if test=" null != enable "> | |||
| and `enable` = #{enable} | |||
| </if> | |||
| @@ -18,15 +18,14 @@ | |||
| <result column="notifyurl" jdbcType="VARCHAR" property="notifyurl" /> | |||
| <result column="modelnotifyurl" jdbcType="VARCHAR" property="modelnotifyurl" /> | |||
| <result column="verifynotifyurl" jdbcType="VARCHAR" property="verifynotifyurl" /> | |||
| <result column="appid" jdbcType="VARCHAR" property="appid" /> | |||
| <!-- <result column="appid" jdbcType="VARCHAR" property="appid" />--> | |||
| <result column="sms_channel" jdbcType="SMALLINT" property="smsChannel" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`secret`,`publickey`,`bid`,`recharge`,`remains`,`total`,`account`, | |||
| `reminderstatus`,`reminder`,`phone`,`notifyurl`,`modelnotifyurl`,`verifynotifyurl`,`appid`,`sms_channel` | |||
| `reminderstatus`,`reminder`,`phone`,`notifyurl`,`modelnotifyurl`,`verifynotifyurl`,`sms_channel` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -99,11 +98,6 @@ | |||
| </if> | |||
| <if test=" null != appid "> | |||
| and `appid` = #{appid} | |||
| </if> | |||
| <if test=" null != smsChannel "> | |||
| and `sms_channel` = #{smsChannel} | |||