package com.fengqi.wechat.controller;

import com.fengqi.wechat.controller.base.AbstractMenuController;
import com.fengqi.wechat.entity.MessageConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/api/service")
public class MenuServiceController extends AbstractMenuController {


    @Value("${wechat.service.appid}")
    private String appid;

    @Value("${wechat.service.secret}")
    private String secret;

    @Override
    protected String getAccessTokenRedisKey() {
        return MessageConstant.REDIS_ACCESS_TOKEN.replace("${type}","service");
    }

    @Override
    protected String getAppId() {
        return this.appid;
    }

    @Override
    protected String getSecret() {
        return this.secret;
    }

    @Override
    protected Integer getType() {
        return MessageConstant.SERVICE;
    }
}
