package service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import model.advertisement;
import dao.*;

@Service("AdServiceImp")
public class AdServiceImp implements AdService {
	@Resource(name = "AdDaoImp")
	private AdDao addao= new AdDaoImp();
	public void uploadAd(model.seller seller,String adtitle,String adimage)
	{
		addao.addAd(seller,adtitle,adimage);
	}
	public advertisement checkAd(String adtitle)
	{
		return addao.checkAd(adtitle);
	}

}

@@ -9,24 +9,50 @@
 service;%0D%0A%0D%0A
+import java.util.List;%0D%0A%0D%0A
 import javax
@@ -72,24 +72,81 @@
 esource;%0D%0A%0D%0A
+import model.ad_present;%0D%0Aimport model.advertisement;%0D%0A%0D%0A
 import org.s
@@ -194,42 +194,17 @@
 ort 
-model.advertisement;%0D%0Aimport dao.*
+dao.AdDao
 ;%0D%0A%0D
@@ -214,17 +214,17 @@
 ervice(%22
-A
+a
 dService
@@ -280,16 +280,19 @@
 vice %7B%0D%0A
+%09%0D%0A
 %09@Resour
@@ -302,17 +302,17 @@
 name = %22
-A
+a
 dDaoImp%22
@@ -335,200 +335,562 @@
 o ad
-dao= new AdDaoImp();%0D%0A%09public void uploadAd(model.seller s
+DaoImp;%0D%0A%09%0D%0A%09@Override%0D%0A%09public List%3Cad_present%3E getAd()%7B%0D%0A%09%09return adDaoImp.getAd();%0D%0A%09%7D%0D%0A%09@Override%0D%0A%09public List%3Cadvertisement%3E getAdBySellerID(String id)%7B%0D%0A%09%09return adDaoImp.getAdBySellerID(id);%0D%0A%09%7D%0D%0A%09@Override%0D%0A%09public int getNumberOfAdByS
 eller
-,
+ID(
 String 
-adtitle,String adimage)%0D%0A%09%7B%0D%0A%09%09addao.addAd(seller,adtitle,adimage);%0D%0A%09%7D%0D%0A%09public advertisement checkAd(String adtitle)%0D%0A%09
+id)%7B%0D%0A%09%09return adDaoImp.getNumberOfAdBySellerID(id);%0D%0A%09%7D%0D%0A%09@Override%0D%0A%09public boolean addAd(advertisement newad)%7B%0D%0A%09%09return adDaoImp.addAd(newad);%0D%0A%09%7D%0D%0A%09@Override%0D%0A%09public advertisement getAdByAdID(String id)%7B%0D%0A%09%09return adDaoImp.getAdByAdID(id);%0D%0A%09%7D%0D%0A%09%0D%0A%09public boolean editAdd(advertisement ad)
 %7B%0D%0A%09
@@ -903,35 +903,33 @@
 n ad
-dao.checkAd(adtitle
+DaoImp.editAdd(ad
 );%0D%0A%09%7D%0D%0A
 %0D%0A%7D%0D
@@ -924,13 +924,11 @@
 );%0D%0A%09%7D%0D%0A
-%0D%0A
 %7D%0D%0A

Update AdServiceImp.java