package com.cym.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cym.model.Admin;
import com.cym.utils.ConditionAndWrapper;
import com.cym.utils.JpaHelper;

import cn.hutool.crypto.SecureUtil;

@Service
public class AdminExampleService {
	@Autowired
	JpaHelper jpaHelper;

	public Admin login(String name, String pass) {
		pass = SecureUtil.md5(pass);
		return jpaHelper.findOneByQuery(new ConditionAndWrapper().eq(Admin::getName, name).eq(Admin::getPass, pass), Admin.class);
	}
	
	
}
