src/com/dream/action/ProductActionM.java

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.dream.action;

import java.io.File;
import java.net.URLDecoder;
import java.util.UUID;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.io.FileUtils;
import org.apache.struts2.ServletActionContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.dream.bean.Product;
import com.dream.service.ProductService;
import com.dream.util.SiteUrl;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

@Controller
@Scope(value = "prototype")
public class ProductActionM extends ActionSupport implements ModelDriven<Product> {

	private Product product = new Product();
	@Resource(name = "productServiceImpl")
	private ProductService productService;

	private Long[] ids;

	//商品图片
	private File upload;
	private String uploadFileName;

	/**
	 * 判断上商品名称是否存在
	 * 
	 * @return
	 * @throws Exception
	 */
	public String isexitsname() throws Exception {
		HttpServletRequest request = ServletActionContext.getRequest();
		String name = URLDecoder.decode(product.getName());
		if (productService.isexitsname(name)) {
			// 存在
			request.setAttribute("isexits", 1);
		} else {
			// 不存在
			request.setAttribute("isexits", 0);
		}
		return "isexits";
	}

	/**
	 * 判断商品编号是否存在
	 * 
	 * @return
	 * @throws Exception
	 */
	public String isexitscode() throws Exception {
后面还有 148 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。