首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
OperService.class.php
】的更多相关文章
OperService.class.php
<?php class OperSerVice{ public function getResult($num1,num2,oper){ switch($oper){ case "+": return $num1+$num2; break; case "-": return $num1-$num2; break; case "*": return $num1*$num2; break; case return $num1/$num2; br…
使用AOP+Annotation实现操作日志记录
先创建注解 OperInfo @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited public @interface OperInfo { public String description() default "";//操作说明 } 然后创建AOP的切面类 LogAspect public class LogAspect {…
CalParcess.php.
<?php require_once "OperSerVice.class.php"; //接受三个数 //isset if(!isset($_REQUEST['NUM1'])){ $num1=$_REQUEST['NUM1'];} if(!isset($_REQUEST['NUM2'])){ $num2=$_REQUEST['NUM2'];} if(!isset($_REQUEST['oper'])){ $oper=$_REQUEST[;OPER'];} //创建对象 $Ope…