package com.reptileclient.jlifeapp.web;

import com.reptileclient.jlifeapp.dao.hm.HmTokenMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fuxubing
 */
@RestController
@Api(value = "导盒马数据", description = "导盒马数据")
public class HmMaController {

    @Autowired
    private HmTokenMapper tmmp;

  
    /**
     * 刷新token
     *
     * @param token
     * @return
     */
    @GetMapping("tokenRefresh")
    @ApiOperation(value = "刷新token", notes = "刷新token")
    public String tokenRefresh(String token) {
        if (StringUtils.isNotBlank(token)) {
            tmmp.update(token);
        }
        return tmmp.selectAll().getToken();
    }
 
}