/*
 * @Author: Your Name lishengyin@sz-sunwin.com
 * @Date: 2022-06-15 22:08:07
 * @LastEditors: Your Name lishengyin@sz-sunwin.com
 * @LastEditTime: 2022-06-16 22:40:11
 * @FilePath: /ins/source/controllers/include/api_v1_User.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#pragma once

#include <drogon/HttpController.h>

using namespace drogon;

namespace api
{
namespace v1
{
class User : public drogon::HttpController<User>
{
  public:
    METHOD_LIST_BEGIN
    // use METHOD_ADD to add your custom processing function here;
      METHOD_ADD(User::login,"/token?userId={1}&passwd={2}",Post);
      METHOD_ADD(User::getInfo,"/{1}/info?token={2}",Get, "LoginFilter");
    METHOD_LIST_END
    // your declaration of processing function maybe like this:
    void login(const HttpRequestPtr &req,
                std::function<void (const HttpResponsePtr &)> &&callback,
                std::string &&userId,
                const std::string &password);
                
    void getInfo(const HttpRequestPtr &req,
                  std::function<void (const HttpResponsePtr &)> &&callback,
                  std::string userId,
                  const std::string &token) const;
};
}
}
