import userCls from './controllers/user.cls.js';
import userClsId from './controllers/user.cls.id.js';
import userInfo from './controllers/user.info.js';
import userClsPost from './controllers/user.cls.post.js';
import userEdit from './controllers/user.edit.js';

import { userClsSchema, userClsIdSchema } from './schema.js';

async function plugin(fastify, opts) {
  fastify.get('/user-cls', { config: { policy: ['user'] }, schema: userClsSchema }, userCls);
  fastify.get('/user-cls/:id', { config: { policy: ['user'] }, schema: userClsIdSchema }, userClsId);
  fastify.get('/user-info', { config: { policy: ['user'] } }, userInfo);
  fastify.post('/user-cls', { config: { policy: ['user'] }, schema: userClsIdSchema }, userClsPost);

  fastify.put('/user/:id', { config: { policy: ['user'] } }, userEdit);



}

export default plugin;
