package com.cirle.scientific.controller.sys;

import com.cirle.scientific.dao.MemberDao;
import com.cirle.scientific.dao.QkjMemberOpenidDao;
import com.cirle.scientific.dao.QkjMemberTaskInfoDao;
import com.cirle.scientific.dao.RegionDao;
import com.cirle.scientific.dto.QkjMemberDto;
import com.cirle.scientific.po.QkjMember;
import com.cirle.scientific.po.SysRegion;
import com.cirle.scientific.pojo.BizCodeEnum;
import com.cirle.scientific.pojo.Result;
import com.cirle.scientific.service.MemberService;
import com.cirle.scientific.service.SysRegionService;
import com.cirle.scientific.service.WeixinService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/sys")
@Api("后台配置相关接口")
@Slf4j
public class SysController {

    @Autowired
    SysRegionService sysRegionService;

    @GetMapping("/getRegion")
    @ApiOperation(value = "获取二级联动的省市信息")
    @ResponseBody
    public Result<List<SysRegion>> getRegion(
            @ApiParam(name = "parentId", value = "父ID") @RequestParam(name = "parentId", required = false) Integer parentId
    ) {
       return Result.success(sysRegionService.getRegion(parentId));
    }




}
