package com.younike.server.controller;

import com.alibaba.fastjson.JSONObject;
import com.younike.common.constant.Constants;
import com.younike.common.constant.WechatConstants;
import com.younike.common.core.controller.BaseController;
import com.younike.common.core.domain.AjaxResult;
import com.younike.common.core.domain.entity.SysDictData;
import com.younike.common.core.redis.RedisCache;
import com.younike.common.utils.StringUtils;
import com.younike.common.utils.http.HttpUtils;
import com.younike.common.utils.sms.AliSmsUtil;
import com.younike.common.utils.sms.AliTemplateCode;
import com.younike.common.utils.sms.RandomUtil;
import com.younike.framework.config.AnonymousAccess;
import com.younike.framework.config.ServerAccess;
import com.younike.system.domain.ServerUser;
import com.younike.system.domain.SysTreaty;
import com.younike.system.param.ServerLoginParam;
import com.younike.system.service.IServerUserService;
import com.younike.system.service.ISysDictDataService;
import com.younike.system.service.ISysTreatyService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * 会员服务地址Controller
 *
 * @author elev
 * @date 2022-01-04
 */
@RestController
@RequestMapping("/server/dict")
public class ServerDictDataController extends BaseController
{

    @Autowired
    private ISysDictDataService sysDictDataService;

    /**
     * 获取code信息
     */
    @ApiOperation("获取code数据")
    @PostMapping("/getDictDataValue")
    @ServerAccess
    public AjaxResult getDictDataValue(@RequestBody SysDictData sysDictData) {
        return AjaxResult.success(sysDictDataService.selectDictLabel(sysDictData.getDictType(),sysDictData.getDictValue()));
    }
}
