资源简介
ssm+mysql的网上商城系统,前台商品的展示,添加购物车,结算,商品评价;后台添加商品信息及图片,基本的统计功能
代码片段和文件信息
package com.halfwanybus.controller.app.appuser;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.halfwanybus.controller.base.baseController;
import com.halfwanybus.service.system.appuser.AppuserManager;
import com.halfwanybus.util.AppUtil;
import com.halfwanybus.util.PageData;
import com.halfwanybus.util.Tools;
/**@author liangzhilin
* 会员-接口类
* 相关参数协议:
* 00 请求失败
* 01 请求成功
* 02 返回空值
* 03 请求协议参数不完整
* 04 用户名或密码错误
* 05 FKEY验证失败
*/
@Controller
@RequestMapping(value=“/appuser“)
public class IntAppuserController extends baseController {
@Resource(name=“appuserService“)
private AppuserManager appuserService;
/**根据用户名获取会员信息
* @return
*/
@RequestMapping(value=“/getAppuserByUm“)
@ResponseBody
public object getAppuserByUsernmae(){
logBefore(logger “根据用户名获取会员信息“);
Mapject> map = new HashMapject>();
PageData pd = new PageData();
pd = this.getPageData();
String result = “00“;
try{
if(Tools.checkKey(“USERNAME“ pd.getString(“FKEY“))){ //检验请求key值是否合法
if(AppUtil.checkParam(“getAppuserByUsernmae“ pd)){ //检查参数
pd = appuserService.findByUsername(pd);
map.put(“pd“ pd);
result = (null == pd) ? “02“ : “01“;
}else {
result = “03“;
}
}else{
result = “05“;
}
}catch (Exception e){
logger.error(e.toString() e);
}finally{
map.put(“result“ result);
logAfter(logger);
}
return AppUtil.returnobject(new PageData() map);
}
}
评论
共有 条评论